The actual limit is residency slots. Every year there are many students who graduate from medical school but are unable to practice medicine because they can't get matched to a residency program.
Yep, that's the true barrier to entry. The main issue is there is that Congress has capped the Medicare funded residency roles to the same number since 1997 (Balanced Budget Act of 1997). In that time period, the US population has grown 21%.