Few actors on TV this year have set themselves the task that Natalie Dormer gave herself when she agreed to appear on Showtime’s “Penny Dreadful.”

The imperious Margaery Tyrell of “Game of Thrones” and vixen-like Anne Boleyn of “The Tudors” is playing four different characters over the course of 10 episodes. And not one of them suffers from multiple personality disorder.

The fourth season of “Penny Dreadful,” “Penny Dreadful: City of Angels” — premiering Sunday (10 p.m.) on Showtime — is set in LA in 1938, in the critical years before World War II when the city was building highways to connect the downtown area with then-far-flung enclaves like Pasadena. Nazism was also on the rise and radio evangelists such as Aimee Semple McPherson had a devoted following. Dormer, 38, enters the picture as Magda, a demon who is expert at pitting rival factions against each other and whose malevolence manifests itself throughout the series in the guises of three other women.

Natalie Dormer as Elsa.
Natalie Dormer as Elsa.Justin Lubin/SHOWTIME

Demon Elsa is an unhappily married German refugee from World War I who is disillusioned with what has happened in her own country and who seduces her son’s pediatrician (Rory Kinnear). Alex is the middle-aged assistant to Councilman Charlton Townsend (Michael Gladis), the head of the City Council’s Transportation Committee. Rio is the bisexual ringleader of the pachucos, a Chicano gang that may be connected to the brutal murders of a Beverly Hills family whose bodies, dressed up like Day of the Dead figures, are found along the Los Angeles River by Detectives Tiago Vega (Daniel Zovatto) and Lewis Michener (Nathan Lane).

“Madga is the top of the pyramid from which the other iterations are born,” Dormer tells The Post. “[Creator] John Logan wanted to create an antagonist for the stories. I was looking forward to the technical challenge while trying to humanize and make plausible these three characters.”

Suffused with Magda’s venom, each woman is capable of murder — even mousy, bespectacled Alex, whose crimped hair and nondescript features mark the greatest contrast with Dormer’s natural vivacity. It also may have been Dormer’s favorite role to play among the quartet. She wore tinted contact lenses and a mouth guard set against her bottom row of teeth. “I specifically asked the costume designer to tailor my skirts in such a way that I didn’t move in a feminine way at all,” says Dormer.

Natalie Dormer as Alex.
Natalie Dormer as Alex.Justin Lubin/SHOWTIME

Both Alex and Elsa have ties to the Nazi party, whose supporters rally downtown in Pershing Square and insinuate themselves into the city’s power structure through Alex’s boss in the city council. Rio has a different political agenda. “The pachucos were the first counter teenage culture,” she says. “The statement of the dress code and the hair was way before the Beat Generation was doing it. The Chicano culture was saying, ‘We’re not American and we’re not our immigrant parents who came across the border and are doing all these menial jobs. We’re first-born.’ ”

Logan says Dormer was the perfect choice to play Magda et al.

“I’ve always found Natalie a constantly surprising and constantly mysterious actor; she draws you in,” he says. “The way she effortlessly moves through her many roles in the series — all of which are very different — is amazing to watch.

“There are no camera tricks or heavy makeup, it’s all acting. She’s truly chameleonic.”

“Penny Dreadful” interweaves the struggles of immigrants such as Rio and Elsa but as derivatives of the diabolical Magda, it’s a foregone conclusion that they will favor their lower rather than their higher natures.

“Magda is arguing that mankind has it within himself to take the more selfish course of action,” Dormer says. “He just needs a gentle push.”