What it would look like if Roald Dahl (right) joined the character he wrote in an airplane. Photo-Illustration: Maya Robinson and Photo by Metro-Goldwyn-Mayer Studios and Bettmann/CORBIS

We are firmly in the era of Sad James Bond. Although it began with Casino Royale, Sad James Bond truly became a feature of the franchise after the runaway success of Skyfall — and with the fresh success of Spectre, which grossed an impressive $73 million in its first weekend, the people have spoken. They don’t care if Bond drinks his martinis shaken or stirred, so long as drinks many of them, sadly.

Considering 007’s recent mood, it can be hard to remember that the Bond movies used to be lighthearted, or at least considerably lighter-hearted than the current iterations. While they were never quite on the campy level of, say, Adam West’s Batman, many of the earlier entries in the franchise were rife with heavy petting and dad-quality one-liners, and less concerned with the issue of how sad it must be to live the life of a promiscuous, war-addled workaholic.

But one of the weirdest footnotes in the weird history of “Bond, James Bond” has to do with the fifth film in the series, You Only Live Twice. Like the first four, You Only Live Twice was based on an Ian Fleming novel and produced by Harry Saltzman and Albert R. Broccoli. Unlike the first four, though, screenwriter Richard Maibaum, who would be involved with 12 of the initial 15 Bond films, wasn’t available. In place of Maibaum, Saltzman and Broccoli turned to a friend of the by-then-deceased Fleming, a writer with plenty of experience but very little in film: Roald Dahl.

Yes, that Roald Dahl, as though any other human being in the history of Earth has ever had that name: Roald Dahl, the beloved children’s writer best-known for Charlie and the Chocolate Factory, The BFG, James and the Giant Peach, and a bunch of other darkly menacing tales of morality that drew a distinct line between the good and bad kids. But there was more to Dahl than that. He wrote fiction for adults suffused with eroticism, much of which first appeared in Playboy, and he was a philanderer described by his biographer as “a fantasist, an anti-semite, a bully and a self publicising trouble-maker.” While those qualities might not make you the most enjoyable man to be around, they do seem compatible with a certain superspy — particularly once you watch Dahl’s take on him.

When Dahl took on You Only Live Twice, he diverged from Maibaum’s technique by throwing out most of the Fleming novel it was based on. Instead, what he and the production team came up with is a heightened exercise in camp that would later provide much of the inspiration for Austin Powers: International Man of Mystery, including the lair inside a volcano and the super-villain’s style, scars, and cat. In fact, You Only Live Twice far more closely resembles Austin Powers than it does the Daniel Craig Bond movies; the laughs come often, and not always on purpose.

To put it more bluntly: This film has not aged well. A few examples of why:

James Bond says, “Why do Chinese girls taste different than other girls?” as he kisses a Chinese girl named Ling. Ling says, “Darling, I’ll give you the very best duck,” then tries to kill Bond, but instead helps him fake his own death, and afterwards is never mentioned again. Bond says to a Japanese superspy named “Tiger” Tanaka, “I like sake, especially when it’s served at the correct temperature: 98.4 degrees Fahrenheit.” Bond is bathed by a group of Asian women in bikinis, at which point Tanaka explains to him, “In Japan, men always come first. Women come second.” Bond’s response? “I might just retire here.” Bond chooses a Japanese woman for a massage, at which point she’s replaced by another Japanese woman, Aki, from earlier in the movie. When Bond says he couldn’t finish his massage earlier, Aki says, “This time you shall finish it.” Bond and Aki start inexplicably hooking up, and Aki says, “I think I will very much enjoy serving under you.” Bond goes to see chemical magnate Mr. Osato, and his assistant Helga Brandt says, “Mr. Osato believes in a healthy chest,” to which Bond responds, “Really,” as the camera carefully frames her bosom. Tiger has a ninja school and is training ninjas. Bond is made up to look Japanese, which he very much does not: He basically just gets a terrible wig and weird eye makeup. Bond takes a local Japanese girl as a wife, and her name is Kissy. Aki is killed by poison meant for Bond while lying in bed next to him, which Bond does not mourn or ever mention again. The movie ends with a full-scale ninja attack on the villain’s lair, which bizarrely includes Kissy, whom Bond ends the movie … kissing.

Racist, sexist, and narratively insane: It’s a hell of a trifecta. But in Dahl’s defense, he did sort of back into the whole thing. Journalist Tom Soter interviewed Dahl about the screenplay in 1980, 13 years after the film came out, and Dahl told him, “If you’ve got enough money to live comfortably, there’s no reason in the world to do a screenplay. It’s an awful job.” According to Soter, Dahl’s intro to screenwriting came when David Pecker, the head of United Artists, as well as actor Jackie Cooper and then-unknown director Robert Altman flew out to visit Dahl and begged him to write a script for them. He did, UA loved it, and the script was sold, but the project eventually fell through under the mismanagement of a less-competent director.

But because he was impressed with the script, Picker recommended to Broccoli and Saltzman that Dahl take a shot at You Only Live Twice — a suitably weird project. Dahl told Soter, “It was Ian Fleming’s worst book, with no plot in it which would even make a movie,” and it begins with Bond mourning the death of his wife and ends with him becoming a Japanese fisherman.

Dahl wrote his adaptation according to a formula he was given by the producers: You include three women as love interests, kill off the first two, and end the movie with Bond in the arms of the third. “And there is great emphasis on funny gadgets and love-making,” he added, aptly. Using some ideas cooked up by the producers and screenwriter Harold Jack Bloom, including the fake-burial at sea that opens the movie and the volcano base of super-villain Ernst Stavro Blofeld, Dahl wrote the script and handed it off to director Lewis Gilbert, who, Dahl said, mostly directed the thing as it was written, aside from the rewrites Dahl would do for him when necessary on set.

Although he told Soter he enjoyed the process, Dahl said he was disappointed with the ending of the movie, which was mostly left up to the director. Would he have done another? “They never asked me,” Dahl said. “If you really want to know, I was rather surprised that they didn’t. I think I did a good job, and it was done out of nothing. The others were much easier to do because Fleming had given them good plots.”

It’s also interesting that Dahl never did another Bond because his did quite well: You Only Live Twice was a huge success upon release, grossing over $100 million worldwide, a huge number for 1967. While critical reception wasn’t quite as positive — Roger Ebert wrote way back when, “Like its predecessor Thunderball, another below-par entry, this one is top-heavy with gadgets but weak on plotting and getting everything to work at the same time” — the film has plenty of defenders now, with Entertainment Weekly calling it, in 2006, the second-best Bond ever made.

Dahl’s exclusion probably had more to do with the return of Maibaum, who wrote the next entry in the series, On Her Majesty’s Secret Service, by sticking almost entirely to the novel it was based on. Dahl would go on to adapt Chitty Chitty Bang Bang for Broccoli, based on the novel by Fleming, as well as his own book, Willy Wonka and the Chocolate Factory, which starred Gene Wilder and was directed by Mel Stuart. But Dahl told Soter that, both times, his script was rewritten, and he characterized the experiences as miserable. That marked the end of Dahl’s feature-film-writing career. At least the world got Sean Connery dressed as a Japanese man before it ended.