On the whole, the British comedy movie hasn’t been in the best state lately. The nation that produced Ealing films, Monty Python and “Withnail & I” is mostly down to putting out various ropey TV spin-offs (“The Inbetweeners,” “David Brent: Life On The Road,” “Absolutely Fabulous” et al), and seemingly endless number of films where Maggie Smith or a similar national treasure is withering to somebody. Only a few figures — Edgar Wright, Armando Iannucci, Chris Morris — have made truly distinctive and memorable comedies, but they’ve unfortunately not been anywhere near as influential or successful as the stateside comedy boom instigated by Judd Apatow and co.

So it’s exciting to learn that “Mindhorn” exists, given that it’s a completely original (i.e. not based on an existing TV character) comedy feature film, centered around an outrageous character, roughly in the mold of “Zoolander,” “Anchorman” and “MacGruber.” In this case, it’s the creation of “The Mighty Boosh” star Julian Barratt and Simon Farnaby of “Horrible Histories” and “Yonderland,” and his name is Richard Thorncroft, but he’s better known as Mindhorn.

In his early-90s peak, Thorncroft (played by Barratt) was an actor, the star of a detective show called, yes, “Mindhorn,” about a plain-clothes detective on the Isle Of Man (a location in the U.K. famous for its tax breaks, wittily placed front-and-center here) with a bionic eye that literally lets him see the truth. He was famous, he had the love of a good woman co-star Patricia Deville (Essie Davis, of “The Babadook” and “Game Of Thrones”), but booze and ego made him throw it away and now, nearly twenty-five years on, his only recent work is a commercial for orthopedic socks.

But he’s given the chance to return to the limelight when a serial killer called The Kestrel (Russell Tovey of “Looking”) tells an Isle Of Man police detective (Andrea Riseborough) that he’ll only talk to Mindhorn. He’s initially reluctant to return to former glories, but Thorncroft is eventually persuaded back, and seemingly helps to crack the case. But as he stays on the island, hoping to reconnect with Patricia, who’s now married to his Dutch former stuntman (Farnaby), Mindhorn soon finds there might have been more to The Kestrel than meets the eye.

As far as we’re aware, Thorncroft/Mindhorn was created directly for the screen, but that’s not to say he’s completely distinctive. The vocal warm-ups that we hear in the opening credits immediately put you in mind of Ron Burgundy, while there are hints of Kenny Powers, Garth Marenghi, Steven Toast of “Toast Of London” and Alan Partridge too in his all-consuming ego (Partridge comparisons spring particularly to mind thanks to the supporting presence of Steve Coogan, who plays an old co-star whose spin-off eclipsed the success of “Mindhorn”).

He’s a familiar comic type, but a rewarding one, and it’s great to see Barratt, who mostly served as a straight man in “The Mighty Boosh” and “Nathan Barley,” get a proper showcase like this. He’s very, very funny, wringing every laugh out of his deluded, boozy creation, but nevertheless bringing enough pathos to him that you care about him, despite his cowardice, stupidity and craven self-interest.

The screenplay takes a sort of “Three Amigos”/“Galaxy Quest” approach, with Thorncroft becoming involved in a real-life murder plot, and comparisons to the latter, which is more or less a perfect movie comedy, don’t do “Mindcroft” any favors. But that said, the plot’s involving enough and throws in a few surprises, and the film makes great use of its locations (despite a budget that feels visibly cash-strapped in places), and its recreations of a certain kind of turn-of-the-nineties detective show are decidedly loving.

If the film has a major flaw, it’s that it feels slightly torn between absurd lunacy (provided best by Farnaby’s scene-stealing performance) and something a little more grounded, and ends up feeling a little uneven as a result. But you’ll likely end up forgiving it that flaw, and many others, just because the film is very, very funny, consistently.

From well-handled cameos (Kenneth Branagh is particularly good as himself early on) to deeply silly slapstick, the film throws almost everything at the wall, and a good amount of it sticks. And unlike a lot of comedies of this type, it doesn’t let up on the jokes in the third act in favor of plot, arguably reaching a sort of peak lunacy as it nears the conclusion (though it doesn’t so much end as just stop).

The cast, a pleasingly odd mix of old comedy pros and performers known for more serious fare (Davis acquits herself particularly well, having so much visible fun that it’s sort of infectious, though Riseborough’s character is a bit underwritten), are all very game, and while Sean Foley’s direction isn’t exactly on an Edgar Wright level, he keeps things rattling along, aided by a pleasingly retro score by David Holmes and Keefus Cancia.

“Mindhorn” isn’t slick, and it’s rough around the edges, and we have no idea if it’ll connect with a wider audience. But a “MacGruber”-style cult following at least seems guaranteed, and more than anything, it just feels refreshing for a British comedy to have as much dumb ambition as it has. [B]

Click here for our complete coverage of the 2016 BFI London Film Festival