As others have said, this is a very unusual requirement, so are you sure of it?
If you're on Unix, the easiest/safest way might be to:
- Fork (so you can mess with your child process's copy of the environment without affecting your own copy)
- Loop over each key - delete the key from %ENV, uppercase both key and val, stash them back into %ENV
- exec your child program (your modified environment should be preserved).
You could avoid the fork by keeping a copy of your original environment and then putting it back, but this would be a bit dangerous, since you're messing with process-wide variables here, which could in principle be accessed from a signal handler even if you aren't multi-threaded.