In an editor which is only used for scripts intended to be __main__ ie are normally run as python <path>/startscript.py it seems reasonable that <path> should be on the python path.
I agree that the main method can ensure that the path is fixed, but I wondered if the run as __main__ mechanism used by python -mmodulepath is exposed somewhere for use in scripts?
I think you are right, runpy does the run as __main__ trampoline. I’ve never used or known about it until now. I’ve installed python many times on windows and have always ignored the py thing.