In Iron Man 3, Robert Downey Jr. reprises his role as Tony Stark (aka Iron Man), and Gwyneth Paltrow reprises hers as his girlfriend, Pepper Potts.

Paramout Pictures

The third time might be the charm for some things, but the number three after a movie title is typically shorthand for a deal with the devil.

The studio thinks there's more money to be squeezed from a particular property, and voila: Spider-Man 3, Superman III, The Godfather — God help us — Part III. OK, The Godfather's a special case. Most other threes, though, are what happens when a too-thin plot meets a too-fat budget.

Instead of throwing money at every problem, Stark has to function as a lone gumshoe, think like a garage mechanic, and, when necessary, jury-rig something crude — or, as we like to say nowadays, MacGyver it.

Iron Man 3 conquers the curse of the 3 in a novel way: It pretty much takes Iron Man out of the equation. He's in there, obviously — people would tear down the theater if he weren't.

But Robert Downey Jr.'s billionaire industrialist Tony Stark doesn't spend much time in that computer-generated Iron Man suit, which means fewer cut-ins of Downey's little head inside it, reacting to battles that we know — no matter how much we want to believe — have no actual human component whatsoever.

The excellent idea of director Shane Black, who co-wrote the script with Drew Pearce, is to kick Stark out of his comfort zone. Instead of throwing money at every problem, Stark has to function as a lone gumshoe, think like a garage mechanic and, when necessary, jury-rig something crude — or, as we like to say nowadays, MacGyver it.

Black directed Downey in 2005, in one of the actor's first post-prison vehicles — Kiss Kiss Bang Bang, a good, tense Hollywood private-eye spoof. He knows Downey's best characters have a morbid edge, a mixture of arrogance and self-disgust.

Iron Man 3 begins with a flashback: Stark is telling his story, explaining how his bad behavior created the demons that would change his life. There was a conference in 1999; he was trying to seduce a botanist played by Rebecca Hall, and boorishly blew off a long-haired, partially paralyzed science nerd named Aldrich Killian, played by Guy Pearce. Killian did not, to say the least, forget the slight.

Stark behaves no more wisely a decade later, in the movie's present day. After an explosion in a shopping mall, he sends an on-camera message to the terrorist — The Mandarin — credited with the attack, giving out his home address, challenging The Mandarin to come and find him. "I'll leave the door unlocked," he taunts.

Turns out The Mandarin — or whoever's behind him — didn't need the key; his attack helicopters fire missiles through the windows of Stark's high-tech cliffside manse.

That bombardment has been the stuff of trailers and TV spots for the past six months, and I can only add that it's even more impressive in 3-D; that it's fun to see Stark's girlfriend, Pepper Potts (played by Gwyneth Paltrow), in the Iron Man suit briefly (or at least to see her little head inside, pretending she's in it); and that the shot where the camera seems to plummet alongside Stark and what's left of his house is not just a wowza but a triple-decker wowza with cheese.

Thereafter, Stark is on his own, without an Iron Man suit or most other superhero paraphernalia, and he's still having anxiety attacks from that battle in last summer's The Avengers. It takes a precocious Tennessee adolescent named Harley, played by Ty Simpkins, to push Stark to rediscover his inner garage-workshop tinkerer.

As to the nature of the supervillain and his literally fire-breathing minions, I won't spoil anything. I couldn't if I wanted to, come to think of it, since I never fully understood their powers. I didn't care, though: Iron Man 3 has one rollicking set piece after another, punctuated by unusually good performances from Downey, Pearce, Don Cheadle as Stark's gung-ho buddy Col. Rhodes, and especially Ben Kingsley as The Mandarin, the true nature of whom I shall not reveal.

And unlike most comic-book directors, Black doesn't stint on the killing. An attack on Air Force One has the high body count of the movie Air Force One. It must be said that the timing wouldn't seem to be great for a popcorn blockbuster featuring explosions in American cities, but for better or worse, this kind of picture always seems to get a pass. The audience needs its fix, and nothing gets between us and our superheroes.

Correction May 3, 2013

Early versions of this story incorrectly described the opponents Iron Man fought in the 2012 film The Avengers as the giants of Asgard.