A buddy-action comedy with female leads is still enough of a rarity that one is inclined to welcome “The Spy Who Dumped Me,” which pairs Mila Kunis and Kate McKinnon in a globe-trotting espionage caper concocted by another woman, writer-director Susanna Fogel. But though the talent behind the picture is undeniable, the result proves an uneasy blend of farce and violence, hobbled by jarring shifts of tone. The combination of humor and mystery, along with the question of “Whom should I trust?” that underpins the plot, recalls Stanley Donen’s “Charade,” but that film’s sixties charm and glamour have been replaced by the raucously vulgar humor and overly explicit nastiness characteristic of today’s typical Hollywood product. That’s a pity, since the movie has a lot to offer.

The setup finds Audrey (Kunis), a clerk at a Los Angeles organic food store, despondent over having been dumped, via text no less, by her boyfriend Drew (Justin Theroux); periodic flashbacks show their cute meeting at a bar and subsequent romance. Comforting dour Audrey after a fashion is her constantly high-strung, frantic BFF Morgan (McKinnon), who suggests trashing the stuff he’s left at her apartment, and letting him know they’re doing it.

Drew, meanwhile, is engaged in a desperate attempt to outrun a bevy of assassins in Lithuania—a long chase sequence, punctuated by lots of hand-to-hand combat and capped by a tremendous explosion concocted via a method worthy of MacGyver, that’s played with deadly seriousness. Unbeknownst to Audrey, he’s a CIA agent, and he returns to her in California only to be shot and left for dead in her apartment by another hit-man; before he collapses, however, he begs her to deliver a cheap trophy to somebody named Vern at a café in Vienna the following day. The lives of millions depend on it, he insists.

So Audrey and Morgan are off to LAX on the first leg of a journey that will take them across Europe: they will visit such stunning locales as Vienna, Prague, Berlin, Amsterdam and Paris while trying to evade pursuers that include both bad guys and police (early on, they will be identified by authorities as murderers on the run). Among them is a handsome MI6 agent named Sebastian (Sam Heughan), who identifies himself as a colleague of Drew’s in an important mission, but whom neither Audrey nor Morgan entirely trusts.

It would be a fruitless task to try to unravel all the twists and feints of the cumbersome plot (even an ersatz Edward Snowden, supposedly a friend of Morgan’s, makes an appearance), which centers on a flash drive with an encrypted “back door to the internet” that every country and terrorist group in the world appears to want to acquire and that our heroines find hidden in Drew’s trophy (and occasionally have to conceal, with considerable discomfort, on their persons).

That MacGuffin, however, is only an excuse for a succession of big set-pieces that try to mix comedy and action with varying degrees of success. An extended battle in that Viennese café and a car chase that follows (featuring an over-the-top turn by Kev Adams as the girls’ driver), for example, are played mostly for excitement but with some laughs thrown in, while a later episode, in which the girls are captured and tortured by a steely-eyed Russian gymnast named Nadedja (Ivanna Sakhno), is much too graphically nasty to allow for even a smile.

Then there’s the big finale, set in a Berlin museum where Cirque du Soleil is putting on a show and, while Audrey is wrapping things up with Sebastian and some surprise guests in an armaments room, finally realizing who is trustworthy, Morgan, decked out like a member of the company, gets into an extended brawl with Nadedja on a trapeze. McKinnon tries to inject some humor into the episode, but the big-top action is so brutal that the whole thing leaves an unpleasant taste, especially since it ends with an image that’s actually quite vicious.

On the other hand, there are times when the movie pauses and offers some relatively relaxed, amusing moments: a dinner scene in Prague featuring a creepy host played by Fred Melamed; a nifty cameo by Gillian Anderson as the super-genteel head of MI6, for whom Morgan expresses enthusiastic admiration; and a couple of inserts featuring Jane Curtin and Paul Reiser as Morgan’s loony, laid-back parents. But such instances are few and brief; they quickly end, and the movie is off to the races again, the prisoner of its convoluted plot and Fogel’s need to fill the screen with visceral action and machine-gun verbal riffs.

Kunis and McKinnon are forced to scream a lot as the complications unfold, but they make a good team, with the latter a perpetual-motion Lucy type and the former the more subdued, but mostly game Ethel. Heughan and Theroux provide the necessary male eye candy while keeping the girls guessing as to their motives as long as necessary, and Sakhno is the very personification of agility and ruthlessness. One must, however, feel sympathy for Hasan Minhaj, as Sebastian partner, who’s saddled with some of the lamest jokes the scripters have devised.

Technically the movie is topnotch; Barry Peterson’s crisp cinematography (offering some lovely views of the European locales) and Jonathan Schwartz’s sharp editing help to give shape and rhythm to Fogel’s deft staging of the action sequences, and Tyler Bates’s score adds a few snatches of classical music to accompany the changing locations.

In fact, there are so many good elements to “The Spy Who Dumped Me” that one regrets their not having been put in the service of a better whole.