To add some perspective on Thailand from a fellow resident...
> Thailand. They don't give permanent residency here anyway.
While the process is difficult and there are caps on how many people can receive it each year, people can and do obtain permanent residence in Thailand. I know a number of people with PR, they're all businesspeople who have been here for many years.
> start[ing] a business (expensive and designed to fleece foreigners, beware).
The Thai Board of Investment provides a number of attractive incentives, including a 5 year income tax holiday(!), to foreigners starting a technology business who are willing to commit to modest capital and hiring requirements. Doing business in Thailand is difficult in other ways (limited technical talent, limited and poor English skills, high compliance burden), but I wouldn't characterize BOI as a scheme to fleece foreigners at all. If you are incorporating without a BOI promotion then things are much less attractive, but most software businesses with an intent to hire a few employees will qualify pretty easily.
> you can get excellent care at a tiny fraction of what you pay in the US
True but with caveats. When it comes to affordable, good health care, "better than the US" is not a meaningful standard. The US is a shameful failure in this regard. That said, the cost and quality of health care in Thailand are pretty good--aside from a good private system, Thais and foreigners on long-term visas get free universal health care at government hospitals(!), some of which are pretty good. But it should be noted that private insurance in Thailand carries a number of limitations, such as maximum lifetime payouts and long lists of conditions which aren't covered. In short, the Thai system serves medical tourists very well, but if you're looking for lifelong, comprehensive coverage, things get complicated.
My personal opinion is that Thailand is trying in this area, but currently isn't the best place for most tech businesses to incorporate unless they want access to the Thai market. The main reason for this is the limited talent pool. For some businesses, BOI incentives and the low cost of operating here may make up for this. Either way, Thailand is still a pretty amazing lifestyle destination, and for freelancers/remote companies/very small biz level there are a few options to stay here long-term (Iglu, Elite visa, etc.).