Star Trek IV: The Voyage Home (1986), directed by Leonard Nimoy.
Warning signs of a series going off the rails, with Star Trek IV as a case study:
Comedy: We are understandably suspicious when a series turns comic. I'm thinking of the Christopher Reeve Superman movies and some later episodes of Star Trek: The Next Generation. It's especially perilous for science fiction if we suspect the writers don't know the genre, don't respect it, or are just tired of the creation and want to goof it up.
A defense in this case: the original series had comedy episodes. The plot does not alter the characters, but rather exercises the ensemble in ways that fans love. It helps that this is not a battle or villain story. The previous two films had been serious and violent, and it was time for a change of tone. You can't keep making the same film over and over.
It helps that it is actually often funny. Among the good bits:
Spock's creative swearing.
Chekov asking passers-by: "Can you direct me to the nuclear wessels?"
(Kirk is unable to pay for dinner) Gillian: "Don't tell me you don't use money in the 23rd century?" Kirk: "We don't!"
His expression when she kisses him off at the end.
Time travel: often a cheap, overused plot device. In this case the comedy helps: their insouciant unconcern for changing history, the Prime Directive (does that even apply?), and taking a woman from the past into the future.
Message: too heavy, too much lecturing can be deadly. In this case the eco concerns and homage to Greenpeace are stressed, but the setup is so clever and treatment light enough that it can work. That might depend on your mood.
Catherine Hicks, last seen in The Razor's Edge (1984), is the scientist who loves her whales. Her role is important, as she represents the viewers, including those fans who would rather be in the Trek reality rather than in their own. She reaches a point where she has to believe the unbelievable and make that leap of faith to save her whales. So do we earnestly hope that the optimistic Trek future might actually come to pass.
On a more modest scale, we also hope that any one entry in the Trek canon does not spoil the whole Enterprise.
Notes:
We have an original crew Trek film without the Enterprise, which is pretty amazing.
The space effects are only so-so (no budget) but I found the whale mock-ups to be rather good.
The surreal emergence from the timewarp is strange and I think endearing. How do you represent other dimensions where space, time and mind cross over and intersect in different ways?
Was some Higher Power applying the braking thrusters after both time jumps?
The hostile punk on the bus was their ILM liaison; he wrote and performed the music on the boom box.
They used a real plexiglas factory and a real nuclear powered aircraft carrier (although not the Enterprise).
Harve Bennett wrote the beginning and end, Nicholas Meyer wrote the San Francisco middle, revisiting his own earlier movie: Time After Time (1979).
Totally new score by Leonard Rosenman.
They say that there was never any studio planning for the movies, film to film. They'd make one, go to sleep for a year, then wake up and consider making another. So this trilogy was a happy accident.
Available on Blu-ray with two commentary tracks.
The first track is a happy rewatch with Leonard Nimoy and William Shatner. I don't remember ever hearing them together before, but they are obviously good pals. Nimoy talks more, but Shatner is more thoughtful than I expected. Both have serious eco-consciousness. They go silent sometimes.
The second is by two fans turned pro who worked on Star Trek (2009). They sometimes don't have a lot to say and have obvious gaps in Trek knowledge. They both think the "time travel by slingshot around the sun" was a new invention that needed to be explained. It was used twice in the original series, so I think you just accept it without explanation.