Python\'s access to environment variables does not accurately reflect the operating system\'s view of the processes environment.
os.getenv and os.environ do not func
That's a very good question.
It turns out that the os module initializes os.environ to the value of posix.environ, which is set on interpreter start up. In other words, the standard library does not appear to provide access to the getenv function.
That is a case where it would probably be safe to use ctypes on unix. Since you would be calling an ultra-standard libc function.