Costa Rica has TWO healthcare systems: public healthcare (Caja) and private heathcare. Don't try the former.
Private healtcare in Costa Rica is much cheaper than in the U.S.A. because:
a) Private hospitals and doctors are under no obligation to provide care for anyone who cannot pay. (Can't pay, go to the public hospital)
b) Even insured people generally pay out-of-pocket and get reimbursed. Even with the expectation of getting reimbursed, you pay attention to prices and procedures, and the hospital doesn't inflate the bill with impunity.
c) FDA and drug patent cartel have lesser power, generics are more often available, and geographic price discrimination is more favorable.
d) As far as I know, medical school is shorter term and easier to get in to. In the USA medical school admission is massively restricted to keep the supply of doctors very low and salaries very high.
The USA could learn something, but they are going in the wrong direction.