Tony McNamara would make a lousy history professor. His latest comedy, “The Great,” the story of Russian empress Catherine II, owes more to Monty Python sketches than textbooks.

In the series, now streaming on Hulu, our heroine invents bowling, tells Voltaire to take a hike and swears as if she were just enlightened by Richard Pryor albums.

Don’t bother searching for those historical tidbits on Google; you won’t find them.

“I don’t love period as a genre,” said the red-hot screenwriter, who applied the same fake-news strategy to his Oscar-winning film “The Favourite.” “For me, when I see people in period pieces tying their shoes with ribbons, I wanna kill myself.

“So I was like, ‘What would I watch? What would be exciting for me?’ ” McNamara said this past January. “How do we twist the genre a little bit and make it a show I would watch, and my 21-year-old daughter would watch, and people who liked history could watch, as well, but that was all about the characters?”

Turns out you throw in a lot of kinky sex, sight gags and unprintable language. “Veep” seems tame by comparison.

“There’s all those brilliant turns of phrase and lines of dialogue that you’d never expect to get anywhere else,” said Nicholas Hoult, who plays emperor Peter III as a brainless brat who can’t go nine seconds without referring to his royal appendage. “But they’re all underpinned with this really emotional charge and dynamic characters. [Peter is] a bizarre character, but a lot of fun.”

Hoult, best known for playing Beast in the “X-Men” franchise, gets the comedy’s naughtiest bits, but his co-star Elle Fanning has the more challenging duties.

In the course of 10 episodes, her Catherine must evolve — or devolve — from innocent newcomer to scheming seductress. She never completely gives up on reforming Peter, but still twirls through the palace corridors when she believes he’s been fatally dosed with arsenic.

“What I fell in love with when I read the script is how Catherine has hope for the future. She doesn’t lose that,” said the 22-year-old Fanning, whose work in “Super 8” and “The Beguiled” helped earn her a spot as the youngest juror in the history of the Cannes Film Festival. “But she always has a Plan B, which I really admire. She’s extremely clever and curious, and it’s like, ‘OK, I got knocked a little bit. I’m going to come back and try to figure this out.’ ”

In one of the series’ few wordless pauses, Fanning uses an arsenal of glances to express wincing, flirting and conspiring to various party guests while her husband butchers a violin solo.

She pulls off such exquisite moments while wearing impossibly tight corsets — and with very little experience in comedy.

“I’ve learned so much in the process of this about bringing my walls down and going for it a bit more,” said Fanning, who has more than one scene in which her character squats and urinates in the middle of her bedroom. “It’s like, ‘All right, don’t be embarrassed. Be brave. Be Catherine. Pull a face, go for it, try this wacky thing.’ ”

McNamara’s script doesn’t go completely off the rails. There are references to real-life events, like Catherine’s decision to inoculate herself against smallpox. But McNamara sees his latest comedy as a modern-day celebration of independent women. To drive home the point, each episode concludes with pop hits like Thomas Dolby’s “She Blinded Me With Science” and Suzi Quatro’s “The Wild One.”

“On one level, she’s Catherine the Great who marries Peter and that’s a big story,” McNamara said. “On another level, it’s about a woman who marries the wrong person and then has to go, ‘What do I do? Do I kill him?’ And that seemed like a contemporary question.” Twitter: @nealjustin