A historic $5 billion explosion of rental housing is about to dramatically reshape San Francisco’s skyline, neighborhoods and politics.

Ending last decade’s flirtation with high-end condo towers, the city is rattling and humming with the biggest burst of apartment construction witnessed since Joe Alioto was mayor in the late 1960s and early 1970s. Nearly 8,000 new apartments, mostly in mid-rise and high-rise buildings, will come on line between now and 2015 — 3,498 in 2015 alone. It’s more new rental housing than was built in the last 15 years combined, according to real estate research firm Polaris Pacific.