this question is on the broad side (and possibly opinion-based). The details obvious vary between continent. Airlines in the same continent generally have similar schemes.
First thing first, you are not too old to pursue an airline career with that is what you desire, albeit on the old side of the spectrum.
How much does it cost from day one (no experience) to qualified in airliner (second officer / first officer)?
Roughly $100,000 USD. (If you're interested in a break-down, please ask a separate question).
How do most people fund this?
Most people fund their initial training themselves, i.e. up to solo-qualified, PPL or even IFR.
Then it depends on where you are. A number of flight schools in the United States offer loans (example) to students pursuing professional aviation qualifications. These schools will then recommend their graduates to airlines (example).
In Asia, airlines tend to fund the training on day one, from zero experience all the way to second officer (example), with the condition that once you complete training, you must fly with the airline for a number of years (or pay back your training cost if you want to leave). Competition for these openings are tough. Airlines use a rigid recruitment process to filter candidates, since they are committing a large amount of capital on an individual. Still, not everyone who make it into the cadet program graduate.
You can get around the tough competition if you are rich. I've heard of a story where a person goes to the same flight school where the airline sent their cadet pilots, and fund everything himself. Upon returning, he was hired by this airline immediately.
If it is typically borrowed, how many years (on average) do pilots spend paying off their training?
Ballpark figure around 3~6 years. I have no statistics on this.
Disclaimer: I am not affiliated with the linked flight schools and/or airlines.