Many years ago, Bahrain used to collect a fee in person initially. I had to queue at a kiosk to pay/get a receipt before being allowed to enter the outbound immigration area. Eventually added to all tickets – plus airport/facility fee, not specific to medical stuff. Same with the universal list of taxes and fees added to tickets in the United States. Americans are rich though, and never complain of bearing the costs to cover non-citizens and immigrants. English/UK identical identical.
For this specific charge though, it’s another case of the masses paying for the sins of a relative minority of dirtbags leaking medical bills here. It’s just that Thai people don’t have to bear any burden.
Pax already has to provide credentials when buying tickets online or through an agent. As far as I remember, specific passport details were optional, but you could provide them in advance to streamline checking at the check-in counter. So if you’re Thai and want to avoid the farang tax, provide your Thai passport details when booking, and it should trigger a toll-free code in the system. I’m not a computer person, but it doesn’t seem hard to do. 0=True. 1=False.