Getting over the guards with shotguns at the ATMs took a little time, but not much (I grew up in a bad urban area of a Midwestern city).
Getting over the theft and such, a little while still. But I started figuring out the usual scams and such. (Taxis still only cost $1 at the most, with no tipping expected, anyway.)
I even was able to mostly get over the fact that when you drove 5 km outside of the city that I'd see abject poverty that I hadn't even seen in the worst areas of my rust belt city - stuff that makes this article look like absolutely nothing.
It was a chronic thing: Ex-pats all living inside a literal walled garden, getting everything delivered. This was before Uber Eats and the like, so getting McDonalds and other fast food delivered to the complex was a new thing. Groceries, food, entertainment. And then the constant trips to Hotel del Rey and the Blue Marlin Bar so my co-workers could pick up prostitutes on the cheap with rooms available for rent by the hour...
What I realized slowly over a period of a few months is that it wasn't the insane poverty - and relatively low violent crime rate! - that got to me. It was what we were doing to "gentrify" the area. It felt like, and was, pure exploitation and taking advantage of massive economic gradients. That we worked in tech and could sling some code made us masters of our domain, being paid well-above-average wages for Silicon Valley - and literally unheard of sums in Costa Rica.
We've met the enemy, and it was us.