Eryk Sun firstname.lastname@example.org added the comment:
ntpath.expanduser() no longer uses HOME (though the doc string still refers to $HOME), so at least that problem is resolved.
I suppose IDLE could work around the HOME issue in Windows by passing env=os.environ.copy() in the subprocess.Popen() call that creates the subprocess. os.environ will not contain the HOME value that TCL sets in the underlying process environment.
---------- versions: +Python 3.10, Python 3.8, Python 3.9 -Python 2.7, Python 3.5, Python 3.6