That was my situation, also. It sucked because in general, all the other kids in school who were academically gifted were from well-to-do families, and I think I was the only one taking AP calc or physics whose family couldn't afford the test.
I imagine through either scholarships or taking on bunches of debt. I was nowhere near as aggressive as some other classmates, but I managed to grab ~20k of total scholarships that helped me out immensely for college. Still a small chunk of what was needed for college, but it was an option I had compared to high school just making me eat the admissions and AP test costs wholesale.
Fortunately my parent did cover these costs, but I know others weren't so fortunate.
Correct me if I'm wrong but it seems like you assuming they took the class for credit at university. Community college is also a possibility where it would be cheaper or around the same price. That also comes with the benefit of financial aid.
Community college is cheap, but isn't $65 for four credits cheap. Most financial aid I've seen has been in the form of loans, which also won't be as cheap as getting credit for those classes from testing out.