Booksmart is actress Olivia Wilde’s first film as director, and it’s no surprise that she gets vibrant performances from her cast. Plenty of actors-turned-film-makers do that. Unlike most of them, she does a lot more, breathing hilarious new life into two tired genres. A female buddy film in the guise of a high-school partying movie, Booksmart is endlessly funny and outrageous, yet always grounded by its realistic central relationship.

The concept is familiar. Molly and Amy, nose-to-the-grindstone students, decide to make up for lost time on the night before graduation by going to the cool kids’ party – if only they can find it. With its nerdy heroines, the film echoes Superbad, but without the testosterone-fuelled quest to have sex. In depicting the bond between female friends, it’s a bit like Bridesmaids, but younger. And in its touching depiction of coming-of-age before college, it’s like Lady Bird, but more raucous.

More like this:

What makes Booksmart unique is Wilde’s sure sense of just how much to exaggerate for comic effect. There’s an improbable detour en-route to the party by way of a yacht, and a change of wardrobe thanks to a teacher with a couple of sparkly green dresses in her car. Yet Molly and Amy’s bond, with its shorthand phrases and shared confidences, is intense in exactly the way adolescent friendships are.

Being honest about sex is another way the film grounds its comedy in real life

The film’s stars create their characters with that same perfect balance of reality and larger-than-life absurdity. Beanie Feldstein (Lady Bird) plays Molly, the class president headed off to Yale in the autumn. Feldstein is terrific at delivering deft comic glances and equally good at portraying a character who feels both superior to her less intellectual classmates and deeply insecure. She starts the day in her bedroom, which features a Michelle Obama poster on the wall, listening to self-empowerment tapes, which ludicrously end with angry railing against anyone who doubts you.

Her best friend and class vice-president Amy is just as smart, but less assertive. She is gay and so inexperienced that she’s not even sure of the mechanics of sex with another woman – a secret she reveals to Molly, and, of course, to us. Being honest about sex is another way the film grounds its comedy in real life. Molly encourages Amy to go to the party and make her move with a skateboarding girl she likes, even though they’re not certain if that girl is gay.

Each supporting character is bizarrely funny in their own distinct way. Jared (Skyler Gisondo) is a rich kid trying to buy friendship, and tone-deaf about what to bribe his classmates with. Gift bags containing T-shirts with his picture on them are among his worst ideas. Jared’s best friend, Gigi (Billie Lourd), is a minor character but one of the film’s comic highlights – a dazed, sprite-like creature, who wears gauzy dresses and headbands as elaborate as fascinators, and has an amazing ability to turn up everywhere Molly and Amy are.

Wilde paces each scene with expert timing

Jason Sudeikis plays the head teacher, who flat-out says he can’t wait to get rid of the students. His part-time job puts him in the girls’ path as they try to navigate to the party, and he tells them about an hysterical idea for a detective novel. Ms Fine (Jessica Williams) is the teacher they call for a ride when they are stranded, and who encourages them to take her green dresses to replace what they consider to be smashing party outfits – matching navy blue jumpsuits, with matching berets that can only make you wonder “What were they thinking?”

Wilde paces each scene with expert timing. Every odd wardrobe touch works, and the film’s look is brightly coloured yet believable. She also knows exactly when to drop in a couple of wonderfully inventive scenes. When Gigi tells Molly and Amy that she has fed them drug-coated strawberries, the straight-laced girls lose their minds, and see themselves as Barbie-style dolls. They’re like teenagers who take a tiny sip of beer and suddenly think they’re reeling drunk.

Molly has an especially rich fantasy life. When she spots a guy she has a crush on at the party, her daydream plays out on screen as they dance like Fred Astaire and Ginger Rogers in an old black-and-white movie. Wilde cuts from that to the same guy crushing a beer can against his head.

By the end, Molly and Amy’s friendship becomes genuinely touching. In one crucial scene, we suddenly hear Unchained Melody on the soundtrack, a song about separated lovers that is so melodramatic, over-the-top, and unsuited to the occasion that it creates another comic moment. Like so much of Booksmart, is it totally inappropriate, and just right.

★★★★☆

Love film? Join BBC Culture Film Club on Facebook, a community for film fanatics all over the world.

If you would like to comment on this story or anything else you have seen on BBC Culture, head over to our Facebook page or message us on Twitter.

And if you liked this story, sign up for the weekly bbc.com features newsletter, called “If You Only Read 6 Things This Week”. A handpicked selection of stories from BBC Future, Culture, Capital and Travel, delivered to your inbox every Friday.