Will the real Jim Carrey please stand up?

Carrey offers a convincing portrait of a con man in I Love You Phillip Morris

In the weirdly lyrical comedy I Love You Phillip Morris, Jim Carrey plays a man named Steven Jay Russell. While Steven's character is based on a real person, true identity turns out to be a slippery concept for the oft-convicted con man, imposter and prison escapee.

Steven leads a seemingly ordinary life as a small-town police officer, husband and father, while being a closeted homosexual. A near fatal car accident convinces Steven to come out, prompting him to holler, "I'm gonna be a fag!" before he's even in the ambulance. Later, to finance his fabulous Miami lifestyle — "Being gay is expensive!" — Steven embarks on a career of frivolous lawsuits and credit card fraud. At one point, his devoutly Christian ex-wife Debbie (Leslie Mann) asks, "Is the gay thing and stealing something that goes hand in hand?"

I Love You Phillip Morris raps Debbie for her naïve bigotry, but the film suggests that after years in the closet, Steven took deceptive role-playing to heart. Like last year's The Informant!, the film presents the true story of a genuinely troubled individual as a self-conscious farce. Bad Santa co-scripters Glenn Ficarra and John Requa make their directorial debut with a grating first act dominated by Southern condescension and sight gags based on phallus-shaped clouds.

The film's strained, cheery tone justifies itself when freshly incarcerated Steven falls in love at first sight with the title character (Ewan McGregor). Young, fey Phillip had attached himself to rich boyfriends until circumstance landed him in the slammer. Steven and Phillip become an unlikely pair of star-crossed lovers in their canary-yellow jumpsuits. Steven reveals a genius for gaming the penal system, and brokers Phillip's early release. But after he and Phillip take up housekeeping on the outside, Steven reverts to his duplicitous ways.

I Love You Phillip Morris struggled to find a distributor after premiering nearly two years ago at Sundance because of its unabashed gay content. Steven turns out to be a fascinating role for Carrey for reasons unrelated to sexual orientation, however. Steven's obsessive love of Phillip feels like Carrey's own compulsion to please his audience focused on a single person. Relatively speaking, Carrey's character acting and Steven's con artistry aren't so different.

In I Love You Phillip Morris, Steven alternately tries to seduce and to sucker the people around him, but he's too antsy and ambitious to settle into an ordinary life. Despite its uneven qualities, the film offers a consistently surprising account of a natural trickster's great escapes.