Are you just running Linux as a “sandbox“ for experimenting with Python, or do you need specific Linux distros to mimic a particular target environment, or maybe obscure Python libraries that aren’t included in the major distros?
Also, do you need a graphical environment for Linux or just command line/server-style access?
Parallels runs on M1/M2 - the catch is that it can only run ARM based operating systems, but Linux has supported ARM since forever and there are well established ARM versions of the big distros. If you want a graphical desktop and care about graphics performance then it might be worth getting parallels, otherwise UTM is free (supports graphics but may be slow), as is Ubuntu Multipass (more server style).
(Most python stuff is cpu-independent anyhow and will probably just work, but there’s always the odd technical exception or library with a lurking x86 blob in it).