FOR ALL the wide, high-octane spectacle in the new “Wonder Woman,” perhaps the film’s most special effect involves one central trick: turning the tables on viewer expectations.

Director Patty Jenkins and screenwriter Allan Heinberg take this opportunity to comment on the politics of Hollywood, both on and off the screen — a feat that feels entirely organic to the spirit of their empowered superhero. To accomplish this, the movie deftly uses Diana Prince/Wonder Woman’s divine powers and her fish-out-of-water naivete.

On the screen, the filmmakers knowingly flip the script on decades of film’s storytelling tropes, often with a clever wink.

Early in the movie, for instance, right when our male lead might traditionally see his female counterpart in a state of winking undress by the water (think “Purple Rain,” perhaps, or “Splash”), it is pilot Steve Trevor (Chris Pine) who is now cast as the “bathing beauty” being played for beefcake. What gives the moment an extra comedic twist is Wonder Woman’s complete absence of embarrassment over catching him in the buff, given her lack of male socialization on all-female Themyscira isle.

This sly subversion of expectations continues in scenes of both romantic comedy and action-adventure. Yankee flier Steve Trevor rapidly acknowledges Diana’s physical superiority — whether she briefly holds him captive with her golden Lasso of Truth, or she extends a bulletproof arm bracer to keep him from being shot. In the public sphere, she is the better protector, and he pivots into being a strong support player.

“Who is the guy who is salty and jaded enough that he doesn’t have time for sexism?” Jenkins says of her version of the Steve Trevor character. “If that person is going to help win that battle, he has to [react] like: ‘We’re separating? That sounds great. You do what [you’re best at].”

Through Wonder Woman’s inexperience with mankind’s darker aspects, the film also comments on Hollywood representation of women and people of color.

At one point, one of the men in Diana’s small band of warriors, Sameer (Said Taghmaoui) — an accomplished deceiver, fittingly — even tells her that he would love to be an actor, but that his ethnicity puts him at a casting disadvantage.

“Wonder Woman” is no screed, but the point of that modern meta-context could not be sharper.

To dramatize the pitfalls of typecasting people, the director says, she wanted her hero “to be paired with what sounds like a ragtag team of criminals: ‘Oh, you’re a hustler and a liar, you’re a thief, you’re a killer? What the hell is this?’”

“Yes, that is the stamp you would put on them,” Jenkins tells The Post’s Comic Riffs. “The ‘traitor’ is not actually even taking money. He simply can’t live anywhere else. And so he’s doing what he can here. And the liar is really just an actor who is trying to survive and not be this soldier. And the soldier is not okay with killing after all.”

Arguably the film’s most on-the-nose scene featuring her fellow warriors includes Sameer’s statement that his ethnicity is an impediment to pursuing a career in the West as an actor. The other warriors, including the Native American “Chief,” offer insights that puncture any stereotyping.

“Wonder Woman” runs a bit longer than many solo superhero films, but this scene was especially vital to keep in, the director notes.

“I was absolutely steadfast about that,” Jenkins says. “I wish the movie were five minutes shorter, too. But if each of those characters don’t have that moment, then it becomes a movie about a liar and a thief and a murderer. And I was like: ‘I can’t. That’s not okay.’”

Especially when your period film about a costumed superhero is finely stitched with political commentary that bears striking relevance today.

Read more: