Spelling-bee infiltrator Guy Trilby — played by Jason Bateman — does bad things in “Bad Words,” Bateman’s directorial debut. (Focus Features)

Jason Bateman fully admits his character Guy Trilby isn’t anyone’s idea of a hero.

In “Bad Words,” Bateman’s directorial debut that opens Friday, Trilby worms his way into a children’s spelling bee on a technicality (he never passed the eighth grade). He’s smarmy and vulgar and just not the guy you’d want hanging out with your middle schooler. Or you. Or anyone on the planet. Yet Bateman had to make him watchable enough so that the comedy’s audiences could root for him, if only a little bit.

“It’s not a tried-and-true formula,” Bateman says. “One of my favorite shows growing up was ‘All in the Family,’ and Archie Bunker said a lot of things that were very un-PC, but [Carroll O’Connor] somehow managed to perform the character in a way where you thought it was a place of ignorance rather than a place of hatred.”

Bateman (“Identity Thief”) is known for playing the put-upon nice guy these days, but Trilby doesn’t come out of left field. When Bateman was a child actor in ’80s sitcoms, he quickly found a niche playing smug, manipulative brats who were oddly likable. Helming “Bad Words,” Bateman made sure to bring shading that rescued his latest character from irredeemability.

“You might be saying something very hateful, but it’s important to balance that with a look of regret,” Bateman says. As director, “I knew I’d get that look in the film.”

It doesn’t bother Bateman that Trilby occasionally reaches F-bomb critical mass, often in the presence of a prepubescent tagalong competitor (Rohan Chand). It also doesn’t bug him that Trilby doesn’t come out of the film much of a changed man.

“There are plenty of great movies out there that send their messages in a bit more of a clearer way, with a tighter ribbon around it,” he says. “Those aren’t the films I’m drawn to. I’m reluctant to enjoy things that are too precious. Being in the director’s chair I was able to navigate those moments and put them, for better or for worse, right on my sensibility.”