At the moment I’m trying to handle it my learning to code in the se-layout. Isn’t looking promising though, don’t think I’ll ever get used to the {} (it’s a bit curious that the Mac has the Swedish letters printed on the keys but not the other symbols you need)
I think when I finally give up on this I’ll try a en layout that lets you type the required umlauts and rings by combining instead.
Umlauted vowels are done with AltGr+[ followed by the vowel. ß is done with AltGr+S. It's a tiny bit less ergonomic than having dedicated keys for these letters, but I consider the tradeoff worth it since the letters don't occur too frequently in German and I only need to memorize one keyboard layout.
I don't know if something similar is available for US layouts.
As for communicating in different languages, though, why do you feel the need to regularly switch between the German and US keyboard? IMO the German keyboard can do everything at least as well as the US one can (in terms of accents and so on), except for braces and brackets.
If the latter bother you (I know quite a few people who use the US keyboard for this reason): Why not adjust the second and/or third layer of your (German) keyboard layout and make braces and brackets more easily accessible? Same goes for any features that you might be missing.
A lot of people seem to be recommending switching to an entirely new (first-layer) layout while your issue could probably be fixed by:
1. changing the second and third layer
2. using that same layout everywhere, on both US and German keyboards.
I had a similar problem (Spanish and English keyboard share the () problem, and we have ñ where ; usually is, but Spanish keyboards are qwerty and not azerty). I switched to the US-international keyboard layout and use that to write in any language now. I find it a good compromise, although it's not perfect neither to write in Spanish nor to program/write in English.
It is terrible that ( and ) are on the 8 and 9 keys in German layout and on 9 and 0 on US. It frustrates me to no end (add in how IDEs will auto-complete parentheses and I'm constantly lost in a complex decision tree of how to recover from being one key off) and I can't seem to build muscle memory well like this. The other symbol keys are also a wash. Particular offenders are y and z, ? and -, " vs Ä vs @, as well as + (who came up with the idea of requiring shift for that?!).
I just can't intuitively keep up with what layout is active and/or how to adjust my typing, even if it's always the same for the same application. Frequently I settle for "try one thing and correct if necessary". Obviously slows me down a lot.
Any suggestions welcome.