That's how the concept of virtual address space works. Every process has their own address space which can be addressed. Thanks to this you can't directly read from/write to memory of another process.
You can specify the address where the process base module will be mapped into process memory during compilation/linking process, for example for MSVC linker it ...
Referencing variables with $ only works in the shell or if the program specifically supports it. You simply have to paste or type the old value manually.
Possibly you can use Python scripting to read and write the environment variables.