I love US keyboards for coding, it really improves the experience. Typing in portuguese, however, is not a good experience. The default american layout has the ~ key in a really bad spot. Typing à or ã is REALLY uncomfortable/weird. Fortunately, my keyboard has that key on the right side of the keyboard instead of the left, which greatly improves the experience.
The .XCompose file I linked in the main post is perfect and works great on X11. If you’re not yet on Wayland you can use it and have a great experience.