I'm an American who did the same, and I echo this. The compensation tradeoff was much more pronounced when I moved to Berlin 4 years ago. Covid and remote work changed this: you can now make more-or-less median comp for a second tier US city after adjusting for cost of living (and before accounting for quality of life).
Everywhere's still low compared to the Bay Area, don't get me wrong. But it means you either need to be a salary maximalist, determined to nationalize, to have a strong pull toward a certain US city/company for the move to make as much sense these days.
Still, I'd encourage everyone regardless of home/destination to live and work at least some of their life in another country. The merits of doing so are vast, and extend well beyond renumeration.