Friendship is a gift eschewing all bounds and explanation. No finer example than “Green Book,” Peter Farrelly’s crowd-pleasing charmer about a white Bronx bouncer and an erudite black classical pianist overcoming racial, cultural and educational divides to forge a decades-long bond that we all could take a lesson from. Never mind it’s set in fall 1962, a time when Americans were catching their breath in the wake of the Cuban Missile Crisis.

The message is very much a contemporary plea to end the tribalism and discord currently infesting our civility. If these two dichotomous humans can get along, can’t we all? Probably not, but it’s sure nice for two fun-filled hours to fantasize about the possibility.

Even better, it’s a can’t-miss opportunity to watch two superb actors in Viggo Mortensen and Mahershala Ali spin entertainment gold out of their infectious Mutt & Jeff routine. Well, maybe not initially. For the first 10 minutes or so of this “true” story, I was eager to write “Green Book” off as just another stereotypical bundle of stereotypes emanating from the Farrelly canon, right down to the familiar Greek chorus of the director’s non-actor acquaintances kvetching in addled blue-collar vernacular.

Then it came, the moment when Mortensen’s Tony “Lip” Vallelonga, a temporarily laid-off bouncer at New York’s legendary Copacabana, walks into the eclectic Carnegie Hall penthouse of Ali’s world renowned pianist Dr. Donald Shirley. The latter — dressed in an elaborate kaftan and actively sucking up all the oxygen in the cavernous room — has summoned Lip (the nickname derived from Tony’s honorary degree in B.S.) for a job interview.

Seems Doc needs a big, tough guy to be his chauffeur/bodyguard on an upcoming tour across the Southeast, a place where Jim Crow rules still apply and “uppity” blacks are particularly vulnerable to the racist whims of narrow-minded rednecks. Before either actor utters a word, you’re hooked. And when they do speak — Tony sounding like an extra from “The Sopranos,” Dr. Shirley eloquently suggesting “In the Heat of the Night”-era Sidney Poitier — you can feel your pulse quicken.

And it only revs higher once they climb into their luxurious teal Cadillac Sedan de Ville to hit the road on a two-month concert tour abetted by “The Negro Travelers’ Green Book,” the quintessential blueprint for staying alive below the Mason-Dixon Line. The pamphlet, for those unaware, was a guide compiled by New York City mail carrier Victor Hugo Green (thus the name) listing the cafes, bars, stores and hotels were vacationing blacks were welcome. It also provided tips on varying racial codes, “sundown towns” (no blacks out at night) and byways best left untraveled.

Dr. Shirley surely must be insane tempting fates so brazenly. That’s what Tony thinks; so do we. And the film gives us many a close call to chew on over the course of what proves an eventful journey taking us to grand concert halls, rundown motels, honkytonks and snobby clubs and restaurants were the bathrooms are strictly for whites.

The danger — and racism — is not lost on Dr. Shirley, an American-born, Russian-trained virtuoso who made his celebrated U.S. debut performing with the Boston Pops. He still wants to go forth because he believes it a duty to contribute to a widening civil rights movement aiming to end 400 years of dehumanizing repression. And not just in the South, but in Tony’s backyard, where racist attitudes are more subtle, yet no less demeaning.

That part of the story is undoubtedly moving, but what really gets to you is the ever-evolving relationship between Tony and Doc, as their two distinct worlds collide amid a third world they weren’t totally prepared for: The Jim Crow South.

The script — written by Farrelly, Brian Currie and Tony’s son, Nick Vallelonga — poses no such threat, but its reliance on clichés, third-rate bromides and tried-and-tired road-trip tropes portend dead-ends ahead. But happily they never materialize — or, at least not that you’d particularly notice. Chalk that up to the lively chemistry and overt compassion magically conjured by Mortensen and Ali.

Listening to them is like watching Doc’s long, thin fingers glide gracefully over the keyboard of his preferred Steinway pianos, producing booming chords that shake the soul and awaken possibilities you never envisioned.

 Farrelly is an old hand at these road-trip endeavors, from “Dumb and Dumber” to “There’s Something About Mary” to “Kingpin,” livening up the ride with assorted twists and turns. I particularly enjoyed the running gag (and the nice payoff) of Doc dictating — in a far more flowery and romantic tone — Tony’s letters to his adorable wife (a too briefly seen Linda Cardellini) and kids, Nick and Frank, back home in the Bronx.

But the film’s depictions of Jim Crow and the fear it created are superficial at best and exploitative at worst. The pathology of how the trip awakens and reshapes who Doc and Tony are is merely — no pun intended — skin deep. Yet, it’s something you don’t think about until after it’s over. Credit that to Mortensen and Ali, a most agreeable duet in harmony with an opus that movingly boils down the essence of friendship, that rare gift that determines not just who we are, but what we can be.

Lurking around the edges is a nice riff on identity, with Doc lamenting that people tend to judge him as not black enough, not man enough and not personable enough. Knowing that, is it any wonder he’s so admiring of Tony’s ability to be so comfortable in his own skin, unmoved by what people think or say?

Accordingly, some of the best moments arise out of their numerous culture clashes. One is a family man, the other a loner; one drinks beer, the other Cutty Sark; one is a voracious eater who likes to get down and greasy with a bucket of KFC, the other prefers nibbling a breakfast steak; and one loves Aretha and Chubby Checker, the other the composer Chopin, or Joe Pan, as Tony hilariously calls him. Yes, the humor, and the drama, is often obvious, going for the easy marks, particularly the borderline offensive Italian stereotypes hung on Tony.

But “Green Book” is so relentlessly enjoyable and the two leads so pleasurable, you can’t imagine skipping the ride.

— Al Alexander may be reached at alexandercritica@aol.com.

(PG-13 for thematic content, language including racial epithets, smoking, some violence and suggestive material.) Grade: A-