Perhaps the distributor could drum up viewership for Nash Edgerton’s dark action comedy by advertising that one of its main characters is The Black Panther, but doing so would be somewhat deceptive, since in “Gringo” that’s merely the nickname for the murderous head of a Mexican drug cartel. Still, given that as scripted by Anthony Tambakis and Matthew Stone, the movie is just a collage of feints and misdirection, such a campaign might actually be appropriate to its anarchic spirit.

The hero of the piece—after a fashion—is a very unlikely gringo indeed: Harold Soyinka (David Oyelowo), a principled Nigerian immigrant who’s operations director of a Chicago pharmaceutical company headed jointly by his college pal Richard Rusk (Joel Edgerton, Nash’s brother) and cynical, sharp-tongued Elaine Markinson (Charlize Theron), with whom Richard is sharing more than office space. Harold is married to gorgeous Bonnie (Thandie Newton), but his accountant warns him that her expenditures as an interior designer are bringing them close to bankruptcy.

That’s actually the least of Harold’s worries. Unbeknownst to him, Richard and Elaine are planning to sell the company—which is about to launch a prospectively game-changing marijuana pill called Cannabax—to a larger firm headed by a goofy fellow named Jerry (Alan Ruck). To smooth the way, however, they need to sever ties with drug lord Villegas (Carlos Corona), aka The Black Panther, whom they’ve been supplying with pills produced in their Mexican factory. Harold has heretofore handled all the firm’s dealings with the guys who run that factory, but Richard and Elaine accompany him on his latest trip south to handle the matter while keeping him—their patsy, who will be dumped when the merger happens—out of the loop.

From this point things spiral completely out of control. Villegas, who juggles a comic obsession with the Beatles with a penchant for abruptly offing people who disappoint him, is in no mood to give up his lucrative sales of the company’s pills. He decides to seize Harold and force him turn over the formula for them. Meanwhile Harold has gotten wind of his betrayal by Richard and Elaine—as well as the infidelity of his wife—and plots to fake his own kidnapping with the help of the owners of the seedy hotel he takes refuge in, so that Richard will have to pay off the “crooks” but he will actually pocket the ransom.

Of course, Howard’s plan goes awry. For one thing, Villegas’ thugs—including Howard’s long-time driver Angel (Yul Vazquez)—are after him, and if that weren’t bad enough, his hotel helpers decide to rework the scheme to their benefit. For another, Richard tries to handle the problem by sending his brother Mitch (Sharlto Copley), a former black ops guy turned aid worker—to deal with the situation in a more expeditious and profitable fashion. And there are others brought into the mix, including a young American couple staying at the same down-on-its-luck hotel as Howard: Sunny (Amanda Seyfried), the only genuinely good person in the whole entourage, and her boyfriend Miles (Harry Treadaway), who, it turns out, is working for a rival pharma company.

Everybody in “Gringo,” in fact, turns out to be a back-stabber but one, and the picture’s view of human nature is uncompromisingly bleak. If one can put up with that, though, the picture can be enjoyed on a very rudimentary level simply because, despite a few logical holes in the script, the intricacies and reversals tie together reasonably well. The style, to be sure, is rather cartoon-like, though with a far grimmer, more violent edge than Bugs Bunny would ever have tolerated. But as pure comic-action pulp, it at least avoids getting into the scummier regions that such earlier tales of nefarious doings south of the border like Oliver Stone’s “Savages” or Ridley Scott’s “The Counsellor” descended to.

That’s largely due to the nimbleness of Nash Edgerton’s direction; he may not juggle the balance between farce and mayhem with much elegance but avoids the worst possibilities of wrenching tonalities. And the cast sinks their teeth into the material with relish. Brother Joel does his best, but he’s easily surpassed by Theron, who takes bitchiness to new heights here, and Corona, whose mad cartel boss offers equal measures of wackiness and sheer brutality. And while Treadaway is pretty much a cipher, Seyfried brings a welcome dose of simplicity to her role without making the character a naïve dolt.

Then there is Oyelowo, so dignified as Martin Luther King in “Selma,” who does a complete turnaround here as the baffled, overwrought Harold. It’s a role that, as written, could have been played as a complete stereotype of the hapless foreigner, and in truth there are a few moments when the actor straddles the line, doing routines of pleading and crying that take us back to a cruder, crasser era of portrayals of blacks on screen. But in each case Oyelowo manages to quickly add a touch of poignancy to his act, and in the end Harold emerges as a figure more worthy of sympathy, even a degree of respect, than simple pity. Though it can hardly be said that the picture’s ultimate message is that honesty is the best policy—at least one obvious bad actor gets off scot-free—Harold’s fate suggests that there’s still something in that old nostrum.

In technical terms “Gringo” in no great shakes. Eduard Grau’s cinematography is gloomy and a trio of editors—David Rennie, Luke Doolan and Tatiana S. Riegel—sometimes seem hard-pressed to keep all the convolutions straight (the final confrontation scene is a bit of a mess). But thanks to the efforts of a talented cast and spirited direction, this nasty mixture of cynical farce and violent action offers a few pleasures along the way—though not quite enough.