When Hollywood wanted to bring to life Tony Stark, the comic-book engineering prodigy who grew up to be the billionaire industrialist and slick playboy alter ego of Iron Man, it turned to the closest thing the real world seemed to offer.

"We need to sit down with Elon Musk," Robert Downey Jr., who plays Stark in the blockbuster film series, told his colleagues. Jon Favreau, the director, hailed Musk as "a Renaissance man in an era that needs them."

He lacks — for now — the superhero's jet-powered suit of armor. But in the 12 years since making his fortune from the sale of the online payment firm PayPal, Musk has become a man whose vast wealth, wild ambitions and turbulent personal life are scarcely less cartoonish.