There’s a strange allure hidden beneath the surface of some of Quentin Tarantino’s most popular films: his willingness to audaciously rewrite history and play games with time in order to achieve a happy ending despite the bleakest of circumstances.

In “Django Unchained,” Jamie Foxx’s title character got to unleash hell upon his slave owners and exact brutal retribution in a way that few if any real-life slaves were able to achieve. And in “Inglourious Basterds,” a ragtag team of soldiers were able to wipe out Hitler and his highest circle of Nazis in a blaze of fiery glory.

In his latest film, “Once Upon a Time in Hollywood,” the writer-director plays fast and loose with one of the most gruesome mass killings in modern times on the eve of its 50th anniversary: the murder of pregnant actress Sharon Tate and four of her friends on Aug. 8, 1969 by members of Charles Manson’s psychopathic cult.

“Hollywood” centers its focus primarily upon two fictitious side characters — a fading 1950s-era TV Western star named Rick Dalton (Leonardo DiCaprio) and his best friend and stuntman, Cliff Booth (Brad Pitt) — who are slowly slipping down the drain of the film and TV industry a decade after their prime. Rick at first is in denial about his fall from being the heroic star of a series called “Bounty Law” in the late ’50s to being a guest bad guy on sporadic TV series at the time of the movie in 1969.

As Rick veers between a falsely strong front and frequent crying jags, both compounded by too much liquor, Cliff is carefree and laughing his way through life. But when Rick gets told by a producer (Al Pacino) that his only shot at regaining stardom lies in heading to Italy to make Westerns and James Bond knockoffs, both men face a fearful look at reality.

Meanwhile, real-life actress Sharon Tate (Margot Robbie) is on the rise, and lives next door to Rick with her acclaimed director husband Roman Polanski. Rick believes that if he can just get a chance to interact with the power couple, they would give him the opportunity to be a star again.

The third main storyline follows a mysterious group of young women whom Cliff keeps running into while driving around Hollywood. When he agrees on the third sighting to give one particular woman a ride to where she lives under the rule of Charles Manson at a place called Spahn Ranch, he realizes something very strange and very wrong is looming among that group in the hills.

Tarantino ultimately weaves these three highly disparate strands together in a very bizarre, action-packed alternate reality in its final half hour. The sequence is funny and exciting, but it left a funny taste in my mouth when considering that the film is in a way making light of a horrific situation.

If you don’t mind a movie bending reality on a tragic circumstance to create  a happy ending, you’ll be fine with its approach. If you think that tragedies are sacrosanct, you won’t.

That said, “Hollywood” continues Tarantino’s tradition of drawing iconic performances out of his leads, with DiCaprio and Pitt clearly having a blast playing these two good ol’ boys while still showing layers of emotional depth at unexpected moments. DiCaprio in particular is fun to watch as he reveals his impressive comedic abilities in a tightrope performance that recalls his excellent work in “The Wolf of Wall Street,” and the pairing of perhaps the two top movie stars of our times is an ingenious delight.

Robbie as Tate has less to do, as she’s mostly seen as a sweet party girl who happens to be landing some key roles and spends a big chunk of her screen time watching herself in a movie at the Bruin Theatre in Westwood, soaking up the laughter of the audience around her. The Manson cult members are mostly ciphers, with Manson barely appearing onscreen at all.

The fact that the Tate and Manson cult stories are relatively sparse in the movie poses some structural problems that make them of less interest than they should be. Tarantino also weakens the film by indulging his overlong plot to a punishing 165 minutes (that’s two hours and 45 minutes, folks!), with at least four major scenes seeming to be 10 or 15 minutes long when they should have been three to five minutes, tops.

Yet, in considering the film overnight before writing this review, I wound up with a greater appreciation for its unique vibe and strange sense of optimism. There is an incredible amount of attention to detail throughout, with Tarantino’s most enjoyable soundtrack since “Pulp Fiction,” a terrific soundscape utilizing classic radio ads from the period and amazing set design that truly transforms Hollywood back to 1969.

It’s also a kinder, gentler film than one would expect from this master of fast-bursting graphic violence (well, until the finale, which is gruesomely funny nonetheless) and one that those seeking fun characters, an unpredictable plot and the ability to sit for nearly three hours in a theatre should enjoy.  

“Once Upon a Time in Hollywood”: B