Actually there is a way around that. While we can't change a file in snap directly (without rebuilding it - that would be too hard), we can exploit mount's bind functionality to achieve the similar effect.
Caveat: I wouldn't recommend doing it permanently, but this can be invaluable for temporary debugging.
I will use certbot as an example. Its main.py file is located in /snap/certbot/952/lib/python3.8/site-packages/certbot/main.py. First we need to copy it somewhere:
$ cp /snap/certbot/952/lib/python3.8/site-packages/certbot/main.py /tmp/main.py
Then we edit the copied file:
$ echo 'print("no help for you!"); exit(1)' > /tmp/main.py
And now we mount the edited file over the original one:
$ mount -o ro,bind /tmp/main.py /snap/certbot/952/lib/python3.8/site-packages/certbot/main.py
Test the results:
$ certbot --help
no help for you!
And when you are done, you can unmount the file:
$ umount /snap/certbot/952/lib/python3.8/site-packages/certbot/main.py
Again, I don't think this is very useful as a permanent solution - major updates to the underlying snap package will break something. If all you want to do is to change some configuration then using built-in configuration methods will be probably much easier and more maintainable.
If for some reason you still want to use this as a permanent solution, then you will need to tweak the idea to persist across reboots - store the changed file in some stable directory (not /tmp/), and make sure the mount happens during startup (I believe that it can be done using /etc/fstab entry).