Python flag/envvar to not put current directory on sys.path (but don't ignore PYTHONPATH)

Oh right. I wrote gh-57684: Add -P cmdline option and PYTHONSAFEPATH env var by vstinner · Pull Request #31542 · python/cpython · GitHub to add -P option to Python, so you can add -P to the shebang to avoid the issue. Somewhere, it was proposed that setuptools should use such option since it generates scripts from entry points.

3 Likes