When “DC’s Legends of Tomorrow” returns to The CW with its third season this fall, viewers will be introduced to a new superhero: a Muslim computer hack from the future named Zari Adrianna Tomaz, played by actress Tala Ashe.

Adding a Muslim character in the midst of the current political climate was no coincidence.

“You might have heard there was this election,” cracked executive producer Marc Guggenheim on Wednesday at the Television Critics Association press tour in Beverly Hills. “Not to get political, but something that we all gravitated toward in the writers room was making this character Muslim.”

“Representation is a really powerful thing,” said Ashe, who plays the Muslim superhero. “When I was growing up watching television, I didn’t see anyone who looked like me. When I think of the kid version of myself, I think it broadens your perspective. What I think is so lovely about this show is that the Legends are this tapestry that represent America today.”

Stressing that the writers on “Legends of Tomorrow” make a point not to define a character by their race, religion, or sexual orientation, Guggenheim also said that his personal experiences inspired the decision to create a Muslim character this season. Sharing a story about his sister-in-law, who happens to be Muslim, the producer said, “She was talking about how difficult it is to be a Muslim-American in the current political climate. Having a character who’s a computer hacker and is from the future but also happens to be Muslim, it’s a nice, important aspect of her character.”

Asked by a reporter how else global politics have influenced the upcoming season, Guggenheim said, “It’s not just politicians — a lot of the heroes of real life are letting us down.”

“We’re being let down as a society,” Guggenheim continued. “I think the reason why the audience and the creatives are gravitating toward superheroes is because it’s wish-fulfillment. They’re looking to find a little bit of hope and a little bit of escapism that quite frankly doesn’t exist.”

Executive producer Phil Klemmer added, “We’re all looking toward the day when 2017 is in the history book and hopefully isn’t the last day in the history book. I find the current world difficult to comprehend.”

Guggenheim also said that aside from bringing on a Muslim character, the writers were interested in bringing on another female character.

“There weren’t enough women quite frankly,” he said. “It’s something we were looking to address.”

Klemmer chimed in, adding that “Legends” is comprised of an ensemble who all bring different points of view, like Ashe’s character. “We want somebody to bring a new point of view,” he said of introducing new characters. “Whenever you’re doing a scene with eight people, everybody needs to have a distinct voice … it’s interesting to bring in someone who has a totally new perspective on history.”