Module search security 8830

It seems like some core contributors aren't the biggest fans of this, but this is a concern which should not be completely ignored.
I think that this is reasonable to protect against on multi-user Windows systems.
I would also update the accompanying docs.
I do not like what I'm doing with environment variables in the test, so if there is a better way to mock $HOME or the process module, please let me know.
Is this part necessary? Each test is run in a separate process, so the env gets reset.