In these troubled times of war and immorality, it should comfort adult entertainers everywhere to learn that, at least according to director Stephen Frears’ “Mrs. Henderson Presents,” taking off one’s clothes is a patriotic duty. While the charmingly British film occasionally slips into pedagogy on one end of the spectrum and silliness on the other, it is an overall gem — fast, fun and star-studded enough that a few flaws can be easily forgiven.

The story, inspired by true events that took place in the early 20th century, features screen legends Dame Judi Dench (M from the James Bond movies, among other notable roles) as Laura Henderson, a feisty widow with liberal leanings that make her high society cohorts uncomfortable, and Bob Hoskins (memorable from “Hook” and “Who Framed Roger Rabbit”) as Vivian Van Dam, the Dutch Jew who drives her crazy when he’s not busy orchestrating a vaudeville review featuring live nudes.

The story begins at Mrs. Henderson’s husband’s funeral: The spirited septuagenarian inherits a large sum of money, rows her boat on the lake, sheds some tears, and very quickly gets fed up with widowhood. To cope with the boredom, she tries embroidery and committee membership at a friend’s suggestion, but after a montage of failed attempts decides to buy a run-down theater in the West End instead. She hires Van Dam (“VD”) to run the show, and the seasoned pros glare and quibble their way to a charming odd-couple partnership and commercial success. That is, until finances begin to fizzle and drastic measures become necessary. To save the theater, Mrs. Henderson proposes a bold move: a nude review in the style of the Parisian Moulin Rouge.

Mrs. Henderson’s radical new concept (and offbeat attitude) challenges the snobbery and stuffy intellectualism of her society friends as well as the misogyny of the time. She uses all her charms to win the approval of Lord Chamberlain (a surprising turn by Christopher Guest), but there are obstructions even her artful spin-doctoring cannot overcome.

As German bombers begin to fly overhead, the Windmill Theater is transformed from a scandalous strip show to a bomb shelter that promises young soldiers a glimpse of the naked female form before they are shipped off to the front.

Although Frears avoids becoming too wound up in the tragic or the profound, the film remains relevant by subtly gesturing towards the big issues while still maintaining the upbeat rhythm of a musical comedy.

More importantly, the movie is just fun. Dench and Hoskins bring a frank optimism and genuine spark to their characters that can’t help but permeate the rest of the cast. Dench maintains a sexy, fresh energy that belies her 72 years, and her chemistry with Hoskins steals the show away from the motionless nudes that earn the movie its family-unfriendly rating. Perhaps this sort of odd-couple bit has been done before, but the magic of the pairing warrants at least one more chance.

Adding to the excitement is the constant reminder that sexual attraction, experimentation and expression all existed in the days before Playboy and Maxim. Slang terms regain their middle-school hilarity when they come from the lipsticked mouths of senior citizens against an old London backdrop that usually yields more history than humor.

While Frears may occasionally struggle to balance this frivolity and fun with the seriousness of the era — briefly wandering into the realm of the sentimental and convenient — in the end he succeeds with a brand of class that would make Mrs. Henderson proud. Even though it briefly gets tripped up by more profound elements, the film is fundamentally an affirmation of the healing power of good, honest entertainment. An appropriate message, coming from such a spectacularly entertaining film.