One of the apostles (Peter, I think) once said that casting John C. Reilly covers over a multitude of sins. The Little Hours is basically a one-joke sketch — medieval nuns swearing like sailors  — stretched out to feature length, but whenever the film starts to run out of gas or repeat itself a little too much, there’s Reilly, its rock and redeemer, turning watery jokes into a potent brew.

He plays Father Tommasso, the overseer of an Italian convent in the 14th century. His charges are rambunctious, to put it mildly. When left to their own devices, Sister Fernanda (Aubrey Plaza) and Sister Genevra (Kate Micucci) are prone to sudden bouts of profanity and even violence. (Whatever you do, don’t let these women near your turnips.) Sister Alessandra (Alison Brie) wants to leave the convent and find a husband, but her father (Paul Reiser) can’t afford to donate money to the church and finance a dowry. Things are already rowdy before the arrival of a virile new caretaker, Massetto (Dave Franco), who fled the house of his master (Nick Offerman) after being caught sleeping with his wife.

The nuns have run off the convent’s previous caretaker, so Father Tommasso senses an opportunity: He’ll hide Massetto at the convent, have him tend to the grounds, and tell the nuns he’s actually a deaf mute so that they will leave him alone. His plan goes very poorly of course, leading to a sort of medieval screwball comedy that’s part The Decameron, part old Nunsploitation movie, and part Monty Python and the Holy Grail — only not quite as funny or as edgy as that combination of elements suggests.

Although they’re the focal point of the action, Brie, Plaza, and Micucci get the short end of the comedic stick from director Jeff Baena’s script. All they have to play is the shock of nuns dropping F-bombs, a gag that’s hysterically funny the first time and not-so-hysterically funny the 20th time. Instead, the best material belongs to Reilly, particularly in his scenes with Franco. After their initial encounter, Father Tommasso hears Massetto’s confession. In close-up, Reilly carefully assesses each of the man’s sins, one lewder than the next. With his deep wrinkles, intense scowl, and bushy white beard, Reilly looks like he stepped out of a Bergman movie, which makes it all the funnier when he contemplates, with absolute seriousness, what to do about Dave Franco “spilling his seed” all over the place. It’s an incredible sequence.

Offerman, whose line readings are so dry they should come with a drought warning, and Fred Armisen, playing a self-important muckety-muck in the church, both provide solid laughs in supporting roles, enough to make you wish Baena had found more room to feature them. Instead, characters constantly come and go, some without any explanation as to why they showed up in the first place. (I’m still not sure where Jemima Kirke came from, or who she was supposed to be, or where she vanished to after her final scene.)

Baena doesn't quite capture the look of vintage Euro-sleaze, but the grandeur of the high-toned Italian locations makes for a nice contrast with the nun’s sordid behavior, and Dan Romer’s music helps build the mood of solemn piety for Plaza, Brie, and Micucci to deflate with their lascivious antics. The movie could be tighter, but it certainly has some highlights.

On paper, The Little Hours sounds like a combative anti-religious tract, but Baena’s less interested in mocking the church than in basking in the gulf between humanity’s lofty aspirations and its baser instincts. The characters just sort of amble from one incident to the next, and the film doesn’t so much end as it stops. But it arrives at a sweetly non-judgmental message about love, and it gives the final word, fittingly, to Reilly, the patron saint of quirky comedies. God bless him.