Maybe the injunction to “Man up!” isn’t heard quite as frequently as it was a few years ago—except on the stages where “The Book of Mormon” is being performed, of course—but what might be the result if some poor soul took it seriously is treated in darkly humorous fashion in Riley Stearns’s “The Art of Self-Defense.” The film’s tone is audaciously quirky and surrealistic, but in addition to being wickedly funny, the movie is also genuinely disturbing.

The story is about Casey Davies, the quintessential dweeb played, in what most would consider perfect typecasting, by Jesse Eisenberg. He’s a wimpy accountant whose fellow workers, a trio of macho braggarts, look on him with contempt, though his boss seems pretty considerate. He lives alone, of course, and seems to have no friends, of either gender, except for his dog, a droopy dachshund. To put a little excitement into his drab existence he photocopies a naughty magazine he finds on a colleague’s desk and takes it home to masturbate to.

Then one night he has to go out to buy a bag of dog food, despite the fact that the neighborhood has been plagued by an outbreak of muggings. On the way home he’s badly beaten up by a bunch of black-clothed, helmeted thugs on motorcycles. It turns out to be a long recuperation.

The experience encourages him to look into buying a handgun for protection, but after putting in an application for one, he stumbles on a karate dojo, where an authoritarian owner who demands that everyone calls him Sensei (Alessandro Nivola) presides over a clutch of devoted acolytes—all men, except for Anna (Imogen Poots), whom Sensei allows to teach the children’s classes though he otherwise treats her as undeserving of being ranked with the men, though she’ a better fighter than any of them.

Casey decides to join the dojo, and after a rocky start is for some reason taken under his wing by the oddball Sensei, who dispenses the most horrendously macho bromides in a calm, authoritative fashion. Although viewers will certainly perceive him as a dangerous, creepy guy despite—or perhaps because of—his eerily unsettling demeanor (and his oft-stated reverence for his mentor, who—it’s revealed—died a ridiculous death in spite of his iconic prowess), Casey and the other disciples—save for Anna—accept his dicta unthinkingly, even when doing so results in their humiliation or physical harm.

While the picture shows how this sinister system affects some of the other students (most notably a pathetic, envious wannabe named Henry, played by David Zellner, who has the temerity to challenge things), the focus is on what it does to Casey, who becomes insanely devoted to Sensei’s teaching after being promoted; in order to enjoy the feeling of power his recently-won yellow belt gives him all the time, he has a regular belt made in that color for himself, as well as belts in other colors for his fellow students. He also quits his job to manage the dojo’s accounts, and—in a twist that some will consider going too far—he succumbs to the basest instinct that the supposed master’s pseudo-philosophy leads to.

It wouldn’t be fair to disclose how Casey’s faith in Sensei unravels, though it can be said that it involves both personal loss and the secrets he finds in Sensei’s inner sanctum, the “equipment room” that he forbids anyone to enter. There isn’t a great deal of surprise in the decisions Anna takes, but Stearns does have a trick up his sleeve when Casey finally has his inevitable confrontation with Sensei, although you might observe that both he and the character he’s created seem to have watched the first “Indiana Jones” movie.

With his fluttery, nervous air Eisenberg is a perfect Casey, and Potts actually manages to invest the unfortunate Anna with some real poignancy. But it’s Nivola who’s the real revelation. He’s had minor parts in some good movies before, but here he has a major one that he completely inhabits. He makes Sensei a genuinely chilling character, the complete anti-Miyagi.

In visual terms the film is a weird hybrid, with Charlotte Royer’s production design and Michael Ragen’s cinematography mingling what for the most part is a dingy sort of naturalism, complete with strangely empty streets, with splashes of oddball color and peculiar lighting. That, along with the lapidary pacing of Sarah Beth Shapiro’s editing, makes for a continuously off-kilter experience, like a hyped-up dream. Much of the picture does without a background score, making it all the more effective when Heather McIntosh’s brooding music kicks in.

“The Art of Self-Defense” is hardly a movie for everyone. But for those who think it might be a weirdly enjoyable to see “The Karate Kid” turned perversely upside-down in order to investigate the dark underbelly of what it means to be “manly,” here’s your chance.