On Windows, os.environ in Python converts all environment variable names to uppercase. This is normally fine because Windows treats environment variable names as case-insensitive, but it is a problem if you want to see the original casing.
To keep the original case, you can read the environment variables directly from the Windows API using ctypes and GetEnvironmentStringsW.
With this function, the keys in env use the same casing as in the Windows environment block, instead of being forced to uppercase like os.environ on Windows.