Jim Carrey returns to TV on Showtime’s Kidding. It’s a messy triumph.

Kidding is wonderful, terrifying, and heartbreaking at the same time.

Jim Carrey has the kind of face that’s impossible to look away from. It’s not a matter of aesthetics, roughly speaking — it has nothing to do with whether or not you find him handsome. Rather, it’s the sense that he could do anything with it. His features are so elastic, so malleable, that he might express volcanic anger one minute and soul-crushing sadness the next.

When Carrey was younger — think The Mask or Dumb and Dumber — that quality generally translated to mania. He seemed like an unstoppable force, a cartoon character brought to life. His characters could bounce back from anything.

But the performances where it became clear that Carrey and his characters could break are perhaps his most well remembered. The Truman Show, about a man who comes to realize that his whole life has been engineered for others’ entertainment, began to dig beneath the surface of Carrey’s peppiness, channeling the wildness he’s capable of into something different: desperation.

And as the introverted Joel in 2004’s Eternal Sunshine of the Spotless Mind, directed by Michel Gondry, there was even less of a safety net; he was working out of his comfort zone — Gondry prevented him from improvising to keep the character restrained — serving as the polar opposite to Kate Winslet’s bright, brash Clementine.

If there’s some kind of magic formula to his oeuvre — Jim Carrey plus whimsy plus vulnerability equals emotional dynamite — then the new Showtime series Kidding has perfected it. The show, created by Dave Holstein with the bulk of the episodes directed by Gondry (as well as Carrey’s first significant role on TV since 1990’s In Living Color), is heartbreaking, and a rare marvel.

It places Carrey in the shoes of Jeff Piccirillo, who, over the course of three decades, has become beloved by adults and children alike as “Mr. Pickles,” the host of Mr. Pickles’ Puppet Time. That he’s meant to occupy a Mr. Rogers-like space in the pop culture of Kidding’s world is clear from the moment he appears onscreen, clad in a sweater vest and a genial smile, and briefly seen delivering a speech to the US Senate, just as Fred Rogers once did.

The engine that drives Kidding is Jeff’s struggle to reconcile the two sides of himself following the death of one of his sons. In an appearance on Conan, he sings, “You can feel anything at all.” Except he can’t. For the sake of his audience, Mr. Pickles can’t be sad. He has to bounce back.

The deconstruction of a Fred Rogers figure would make for an interesting show on its own, but Kidding transcends that premise by leaps and bounds on the strength of Carrey’s performance and a determination to make the show just as rough — and riveting — as real life.

Jim Carrey’s performance is the glue that holds Kidding’s themes together

 Erica Parise/SHOWTIME
Where is the line between Mr. Pickles and Jeff Piccirillo?

That Carrey inherently seems to have too much of an edge to be a children’s show host — he looks like he wears his heart on his sleeve, including the fact that he’s been through the wringer — works in the show’s favor. It’s unreasonable to expect, as Jeff’s producers do, that the loss of a child will have no visible effect on him, and the brittleness projected through Carrey’s expression only proves the point. Jeff teeters between laughter and tears, with the pendulum swinging dangerously close to anger as he’s restricted from publicly coping, and his steadfast belief that some good must come from pain starts to fall into question.

Jeff tapes a whole Mr. Pickles episode about death, but his executive producer (and father) Sebastian (Frank Langella) shelves it before it ever airs. “You’re a trusted brand,” Sebastian says, by way of explaining what Jeff can and can’t do. For better or worse (mostly worse), “no one sees a man.”

Unable to find closure, Jeff falls into a spiral that’s mirrored in the way that Kidding dips in and out of magical realism. The world of Mr. Pickles’ Puppet Time threatens to swallow Jeff whole as it becomes clear how much of his real life is tied up in it, and how much it’s out of his control. Jeff begins to realize that his own existence no longer belongs to him, figuratively or — as his relationship with his family collapses — literally.

As the performers on the show deal with their own problems in the halls of the studio, the adorable puppets seem to take on much more complicated lives of their own, bleeding into Jeff’s reality in a way that makes Gondry’s influence on the show clear. They’re the kinds of effects and asides that wouldn’t be amiss in Eternal Sunshine or The Science of Sleep, cute enough to infuse the proceedings with a touch of whimsy, but sharp enough to prevent a complete break of reality. It’s a line that’s more clearly walked in Jeff’s demeanor, which is just as tender — if not more so — in his off-screen life.

Kidding wouldn’t work if we didn’t believe that Jeff were capable of catastrophic implosion, and no actor can sell that feeling more keenly than Carrey. When Jeff sees his ex-wife Jill (Judy Greer) with another man, it’s so upsetting that he tears a faucet right out of a sink; the intensity of the action, not to mention the way Carrey stares, is genuinely frightening, making the battle for Mr. Pickles’s soul — or sanity — a journey with real stakes. Jeff is capable of multitudes — to be loved, to be feared, to be lonely, to be mad. Who better to play him than the man who has every single one of those feelings written on his face?

Kidding embraces the messiness of real life, and feels all the better for it

 Erica Parise/Showtime
Catherine Keener and Frank Langella play Jeff’s sister and father.

Like the mind of its central character, Kidding starts to grow scattered, cycling through a range of tones and pursuing separate story threads and character arcs. We witness Jeff’s surviving son Will (Cole Allen) attempt to distinguish himself from his dead twin, and Jeff’s sister Deirdre (Catherine Keener) struggle to keep her own family together while fulfilling her duties as Mr. Pickles’ Puppet Time’s puppet master.

It should all register as frantic, and yet, in the four out of ten episodes sent out for review, it never does. In part, that’s due to Kidding’s uniformly terrific performances, particularly Greer’s and Keener’s, as they shoulder the emotions that Jeff is suppressing.

But it’s also due to the way each thread of the story coalesces under a banner that’s ultimately hopeful, as is befitting Mr. Pickles. That isn’t to say that Kidding disregards the way sadness and anger factor into everyday life, as Jeff’s producers do in order to keep Mr. Pickles going; Carrey’s face is a canvas too expressive for a message that simplistic.

Even Jeff himself is written in such a way that he can’t be pigeonholed as a character one way or the other. When it seems he might be becoming too much of a Mr. Pickles-esque saint, one need only remember that he bought the house next door to that of his estranged family in order to remain close to them.

But, as its central character does, Kidding seems to believe that there’s a balancing good somewhere out there in the universe, or at least there’s some good to be had in seeing the best in people. Though at times that may seem impossible — storm clouds almost literally gather on Jeff’s brow when the constant arguments that the world is inherently ugly start to seep through his armor — it’s that earnestness that ultimately saves the series from completely breaking apart, and will hopefully save Jeff, too.

Kidding premieres Sunday, September 9, at 10 pm on Showtime. The pilot is streaming early on YouTube.