Though there’s some scholarly dispute about it, William Shakespeare is popularly thought to have written his ageless comedy “Twelfth Night” for a royal celebration during Epiphany season. Whatever the case, there is indeed some irreducibly festive spirit in this rollicking mistaken-identity play, and it is in full bloom in the bright, bouncy new production that just opened at Shakespeare in the Park and runs through Sept. 14.

The Public Theater, which produces this annual free offering, has reason to celebrate: After a hiatus last summer to complete an $85 million renovation, the beloved Delacorte Theater in Central Park has reopened as a sleeker, more comfy, more accessible version of itself. You could apply each of those adjectives to the show onstage as well: Director Saheem Ali has judiciously trimmed the text and kept the play’s action humming along, while leaving space for gorgeous reveries sung by the otherworldly Moses Sumney and comic interludes that land their laughs without overstaying their welcome.

The production has also seamlessly woven in the identity of its leading lady, the irresistible Lupita Nyong’o, who plays the shipwrecked Viola as a refugee from Africa; she and her lost twin brother (played by Nyong’o’s real-life brother, Junior Nyong’o) speak Swahili to each other, and at one point, Lupita offers a sweet rendition of the iconic lullaby “Malaika.” The setting is matter-of-factly contemporary throughout, with the lovelorn Duke Orsino (Khris Davis) pumping iron while a string quartet plays, and the mourning Olivia (Sandra Oh) swooning in an elegant black-and-white gown that wouldn’t be out of place on a red carpet (costumes are by Oana Botez).

Maruti Evans’s set is dominated by huge block letters spelling out the play’s inviting subtitle, “What You Will,” painted in various colors by Bradley King’s shifting lighting. Ali’s production has a similarly masterly control over the play’s alternating modes of ardor and irreverence, as the absurdly circular love triangle at the play’s center—Orsino pines for Olivia, who pines for Viola, who pines for Orsino—winds its course on one track, while on another track, bibulous Sir Toby (John Ellison Conlee) and scheming Maria (Daphne Rubin Vega) tease the gullible Andrew Aguecheek (Jesse Tyler Ferguson) and torment the officious Malvolio (Peter Dinklage).

That last character is the fly in the ointment of “Twelfth Night”: a persnickety, puritanical foil who ends up cruelly persecuted, and whose humiliated appearance at play’s end almost derails the bliss of a double wedding. For his part, Dinklage plays Malvolio with a terse, robotic speech and gait that are both cartoonishly funny and pathetic. In his final scenes, he acquires a stoic, chastened dignity that is too late to save him but which clearly moves Oh’s Olivia; you can see her put a slight asterisk on the show’s happily-ever-after vibes. Then, after a pause to briefly consider Malvolio’s fate, Davis as Orsino gets a big laugh with one subject-changing word: “Meantime…”

Indeed, single words have a habit of popping afresh in this production. I’ve never heard “soft,” that famous Shakespearean interjection, used so pointedly, as a kind of self-soothing pacifier for characters who realize they’ve become a little too wound up. “Not too fast: soft, soft!” exclaims Olivia when she realizes she may be falling in love with a young man at first sight, and Oh gives that second “soft!” the full value of that exclamation point. She also somehow finds bewildered comedy, and adds a few exclamation points, to the word, “Gentleman!”—an efficient way to highlight both Olivia’s incipient boy-craziness and the delicious irony of play’s central gender swap, for of course the young man she loves is not a man at all but Viola in disguise.

Joe Tapper and Lupita Nyong’o in ‘Twelfth Night’ now playing at the Delcaourte Theater in Central Park
Joe Tapper and Lupita Nyong’o in ‘Twelfth Night’ Credit: Joan Marcus

More than its overall pace and tone, this attention to detail is what makes this “Twelfth Night” stick. It’s there in every endearing moment of Lupita Nyong’o’s utterly convicted performance, both her effusions of irrepressible joy and her pangs of heartsick longing. It shows up in a few memorable comic bits: Malvolio blow-drying away cocaine from the edge of Sir Toby and Andrew Aguecheek’s hot tub, a boxing scene straight out of Chaplin’s “City Lights.” And Sumney’s ethereal vocals, to tunes by Michael Thurber, are a balm throughout.

It’s a sign of the show’s quality that even some of the smaller roles get memorable renditions: Kapil Talwalkar makes a tidy meal of the evasive, dissembling Fabian, usually no more than a superfluous sidekick to Sir Toby. And in the thankless role of Sebastian, Viola’s lost “twin” brother, Junior Nyong’o hits notes of constancy and awakening joy.

Of course, the onstage affinity between him and his real-life sister isn’t being acted; it’s for real. It is to the credit of this “Twelfth Night” that the whole production feels infused with a similarly unfakeable fellow feeling—a feeling, crucially, of which we in the audience may partake as well. The show opens, a bit oddly, with Sumney singing a setting of “All the world’s a stage,” from “As You Like It.” But all’s forgiven, because this is indeed Shakespeare as we like it, or what we will.

Rob Weinert-Kendt, an arts journalist and editor of American Theatre magazine, has written for The New York Times and Time Out New York.