
One drawback of virtual machines is that they use a lot of drive space. You can create many snapshots, branch them, etc. Virtual machines offer advantages like "Snapshots", which allow you to save the machine, try something you are not sure about, and then restore the machine back to the snapshot. I run Linux on that Mac in virtual machines. On the other hand, that may not matter in some considerations. My reading on the matter suggests that linux is still most superior on intel or amd hardware, so I think that for optimal facility, one might consider matching hardware with software. The Macs are made to optimally run Apple's operating systems though linux can run on pretty much any of them. I'm a little out of date having given up my Mac a few years ago. You would need to get Mac's xcode program and perhaps some other generic program-assisting programs.

If you want to cross-compile for linux architectures, that's possible.

The terminals and IDEs if you want them are mostly available. Nearly of the linux programs are downloadable to the Mac through the homebrew package management system, which includes the C coding essentials like gcc and clang and all manner of other programming languages. I can't tell you which is the best linux distro for the Mac M1, but what I can tell you is that your Mac can be run very similarly to a linux computer.
