HEADING INTO the second season of Netflix’s “Daredevil,” new producers Doug Petrie and Marco Ramirez know they are working with an impressively stacked roster of superheroes.

Under producer Steven DeKnight (who has moved on to the “Transformers” franchise), “Daredevil’s” much-lauded first season worked at a slow and steady pace as it built toward the transformation by Matt Murdock (Charlie Cox) into the title hero. That change concluded with Dardevil’s battle against Kingpin for the very soul of the Hell’s Kitchen setting — a showdown that occurred in the season’s 13th (and final) episode.

Now, as Season 2 of the Marvel/Netflix series kicks off (let the binge-watching begin Friday), Daredevil has become comfortable in his role as his city’s nightly masked guardian — as well as with the reality that he’s not the only one running on the rooftops and making his own rules.

Joining Daredevil this season are old flame/martial-arts expert Elektra (Elodie Yung) and the heavily armed Frank Castle, aka the Punisher (Jon Bernthal). In Marvel’s larger world, Elektra and the Punisher have both starred in movies that were less than successful prior to the current wave in Hollywood — which explains why the rights for their use have reverted back to Marvel.

“This season, from Day 1, we know we have Matt, we have Elektra and we have Frank Castle, so what story does this want to be?” Ramirez said to The Post’s Comic Riffs. “So it wasn’t like we actively walked away from the other version of Season 1. It just felt like: What [story] do these characters want to tell?”

Petrie said adding two characters to the mix wouldn’t be possible if this were a superhero movie. This only works, he said, because the Netflix format gives them almost more than a dozen hours of storytelling to work within.

“I think we would have been much more leery if Marco and I had been put in charge of a two-hour Daredevil movie and given [Elektra and the Punisher]. I think we would have really questioned that,” Petrie said. “Whereas [with Netflix], you have 13 hours of flowing real estate. The flow of introducing [the new] characters and keeping it through Matt’s perspective and just [thinking]: How can we hammer this guy who is already torturing himself in terms of his conscious and his self-imposed responsibility?

“To have 13 hours to lay the cards down in the order you like — I wouldn’t say it’s a luxury, but I will say it is awfully nice. We never felt cramped.”

Despite all that time to craft Daredevil’s second season, the producers said they had to consistently remind themselves that this was Daredevil’s story. Elektra and the Punisher are so fun to dramatize that they can overtake an episode.

“It was hard. We had to discipline ourselves to not let the story become the Elektra or the [Punisher] story,” Ramirez said. “We had to constantly remind ourselves and the writers’ room that this is the Matt Murdock show. All avenues need to lead to Matt Murdock.

“In comic book movies, specifically where it’s a person going up against seven villains, you’re like: Who the hell is this [story] even about anymore? With us, it was imperative every day at work that we’re telling a Matt Murdock story and yes, we happen to be able to use [The Punisher] and Elektra to get him where we want to get him. But this was always all about Matt — that to us was the key to not letting the baddies overpower your [story].”

Petrie and Ramirez call themselves longtime comic-book fans, and Petrie said that having three classic Marvel characters could have been a complication if the producers had allowed their fandom to take over their decisionmaking process.

“You’ve got three incredibly powerful, rich, motivated, complicated human beings [in these three characters] who are acting out on this very dramatic New York backdrop, operatic stage,” Petrie said. “And in terms of being a straight-up nerd … you want to see that. And I think that’s actually a pitfall that storytelling sometimes falls into. And we have to be aware of giving the audience what they want to see from these characters, what we want to see from these characters and yet always, how can we torture our Catholic Matt today, and what can he learn from the world coming to him.”

And then there’s the costuming. One major decision was to upgrade Daredevil’s suit. Fans will notice that the look of Murdock’s suit, especially the mask, is much more aligned with the look in the comic books. Yes, it’s still a mix of black and red, but the mask — particuarly with the red lenses that hide Daredevil’s eyes — is a nice nod to the comics.

Yet giving Daredevil a new mask wasn’t going to be as simple as Matt Murdock asking his costume designer (he has one on the show) for a new look. Murdock was going to have to earn the new look with a baptism by gunfire, courtesy of the Punisher.

“We knew that we wanted the appearance of the Punisher on the show to change Matt forever. And what better way to do it than to literally have [the Punisher] shoot [Daredevil] between the eyes at the end of the first episode, so that he walks around with the Frankenstein mask for a while?” Ramirez said. “Eventually [Daredevil gets] the new [mask]. There’s very clearly, both visually and psychologically a Matt Murdock pre-Frank Castle and a Matt Murdock post-Frank Castle. Visually we [wanted to] find a way to underline that all the better. We think the new mask looks awesome.”

Before the arrival of the Punisher and his new, horned super-duds, Daredevil almost looks as if he is having fun. While stopping a criminal in Season 2’s first episode, Daredevil flashes a smile on his masked face. This is a feeling and a moment that Petrie and Ramirez were determined for Daredevil to have … for about five seconds.

“We started the season with Matt Murdock feeling pretty good about himself and feeling pretty good about his role as the guardian of Hell’s Kitchen,” Petrie said. “We just thought: We can’t let him be that happy for that long, so we just hit him between the eyes with a sledgehammer as soon as we could…and that felt right.”

In regards to Daredevil’s brief bliss, Ramirez added with a laugh: “I wouldn’t watch the show if he was happy all the time.”

Among other challenges for the new producers: “Daredevil’s” first season had a hard PG-13 rating. In inheriting the Punisher — a character who comes from a mature line of Marvel comics, and who has received R-rated treatment in film — the producing duo handled the Punisher’s requisite violence as best they could.

“As you’ll see in the first couple of episodes, [the Punisher] appears the way the Terminator or Michael Myers appears. He comes in and he’s a horrific kind of new player in the game. Especially considering some of the stuff he’s done in the comics,” Ramirez said. “The Punisher can get really, really dark. You can go horror story with him.”

“We never really pushed it in a certain direction to be more violent,” Petrie added. “We never pulled it back to be less violent. We always follow the dictates of what we think the character’s heart was. And Frank is about getting a job done, and he dehumanizes people to a degree that we want to be horrifying and complicated.”

Beyond the blood and bullets this season, Daredevil now has three love interests.

“He’s got Karen. He’s got Elektra. He’s got New York City,” Ramirez said. “And those three vixens are calling him at all times. His love life is his past and his future. Elektra represents one side of who he is and who he can become, and Karen [Page] represents the other half of who he is and what he can become. He’s not necessarily choosing a mate as much as he’s also just choosing a path.”

And Daredevil’s dual identities tug hard on him this season. The more success he has with one half of his life, the more the other half suffers.

“I think that duality was a big theme for us this year. Matt is Matt Murdock and he’s a guy with a mask. He’s a lawyer and then a lawbreaker. And a homicidal lawbreaker, by the way. He breaks bones. He [messes] people up. He’s very scary in that regard,” Petrie said. “Elektra in some way represents a freedom and an idea that he loves, but is afraid of. And Karen is a much healthier avenue, but he’s not settled within himself yet. He’s still figuring out these two sides of himself. And given two big avenues to pursue with New York City being his truest, deepest love, perhaps.

“Were we trying to torture him? Absolutely. We love torturing Matt Murdock.”

And the producers note that one of the highlights for them was watching Cox and Bernthal create a classic Marvel battle.

“The fact that Matt feels responsible for the Punisher — the fact that the Punisher sees a little bit of himself in Daredevil, but there’s a goodness in Daredevil that he’ll never be able to have again,” Ramirez said. “It’s the relationship between the characters that makes all those scenes pop in a great way.”