The costs only really blow out when you get caught with a maxed-out barrel (etc) or you start paying other people for big stuff.
Most motors can be fully rebuilt for under $1k - that's a new bore, rod kit, bearings and seals, and any other little bits and pieces they might need.
Plastics kits with seat cover are typically $500ish, for everything but the tank (which can usually be restored).
Wheels end up around $500 for spoke kits, bearings, and new tyres (assuming you've got/can find decent rims).
Shock and fork rebuild is about $300 total if you can avoid rechroming.
$200 for decent chain and sprockets.
$150 for new alloy bars, levers, grips.
$400 for a new pipe and muffler.
$500 for the other bits and pieces, like linkage kits, bolts, maybe some Chinese radiators.
$200 for paint (assuming DIY).
What's missing from the list? The total is closer to $4k than 3, but will also give you a considerably better bike than the CR125 in question... The converse point is that old mate's CR doesn't have new tyres, good bars, a new pipe, etc.
It's easy to spend more (and I don't begrudge anyone who chooses to), but a lot of it comes down to choosing the right bike for your goals.
I sometimes wonder why people spend good money on clean original bikes, just to rip it apart and replace three quarters of it with NOS bits...
Similarly, a lot of it comes down to knowing what is still servicable. Replacing everything gives a warm fuzzy feeling inside, but (compared to making a proper judgement on the condition of the bits you have) can be a bloody expensive exercise for no real gain.