Forget about walking on hot coals; this guy sleeps overnight on hot coals and asks for a wake-up call.

The Incredible Burt Wonderstone is a Will Ferrell sports comedy without Will Ferrell and without the sports.

In plot and tone, in a screenplay recipe that’s two parts lunatic comedy and one part shameless sentimentality with a dash of romance thrown in, this magic-themed buddy movie isn’t so different from Blades of Glory or Kicking & Screaming or Semi-Pro or Talladega Nights. (And gosh, Will Ferrell’s made a lot of sports comedies, hasn’t he?)

Burt Wonderstone (Steve Carell) is a pompous, clueless, sexist blowhard who somehow comes across as at least somewhat sympathetic, perhaps because we’ve seen the abuse and the hard knocks he endured as a child.

It’s as if Michael Scott from The Office had actually pursued his lifelong love of magic and had managed to become a successful, albeit old-fashioned and cheesy act, headlining his own theatre at Bally’s in Las Vegas.

Anton (Steve Buscemi), Burt’s childhood friend, gamely joins his pal onstage each night to the sounds of Steve Miller’s Abracadabra, kicking off yet another night of magic that hasn’t changed once in the last 10 years. Their routines are so dated, they look as if they’ve been lifted from a 1950s TV extravaganza.

Therein lies the problem for their so-called magical friendship.

James Gandolfini’s blustery casino owner, the not-so-subtly named Doug Munny, tells the boys their time has passed and it’s time to make way for the new breed of magicians, as personified by the viral-video, cable-TV sensation Steve Gray, a man not afraid to mutilate himself, pound a nail into a table with his forehead or go a week without urinating — all of it captured from multiple camera angles.

As Steve Gray ascends to the height of stardom, Burt scrambles to find work in supermarkets and retirement homes. It’s the latter gig that brings him face-to-face with the legendary magician Rance Holloway (Alan Arkin), Burt’s childhood hero.

Might a comeback for Burt Wonderstone be in the works? Can he pull off his greatest trick of all — making himself relevant again?

A movie satirizing magicians — even rock ’n’ roll hipster magicians — is only slightly more cutting edge than a movie mocking mimes or carnies. At times, The Incredible Burt Wonderstone seems as creaky as old Rance Holloway.

But this is also one dark and wickedly funny comedy.

When Anton pays a visit to a poverty-stricken village in Africa and hands out magic kits instead of, you know, food and clean water, there’s a great visual punch line. Steve Gray’s tricks are so gruesome, audience members alternately applaud and projectile vomit.

Even Rance Holloway has a bit of the sadist in him, as we learn when he explains how he pulled off one nifty little trick.

As the crusty, slightly insane old-schooler with a few tricks up his sleeve, Arkin is a marvel.

Olivia Wilde does fine as the obligatory love interest we always see looming on the sidelines in movies such as this, mooning over the goofy lead because she believes he’s capable of being a better man.

Gandolfini, always interesting on the screen, is a bit miscast as a Steve Wynn-like mogul building a self-named casino. (One can picture a Brad Pitt or a George Clooney adding extra layers of charm and oil to the role.)

And then there’s Carrey, reaching deep into the trick bag that turned him into a star some 20 years ago.

He’s physical, he’s intense, he’s ridiculous — and he made me laugh more than any comedic character in recent memory.