Spock abruptly using the f word during his "colorful metaphor" phase in TVH would have been very funny but ST movies were intended to be PG rated family movies at the time so I know they would have never.
As an aside, what are the different "profanity milestones" in Star Trek?
Hell on TOS

Fairly often, and the show was sold as "adult science fiction" in early commercials. Usually confined to specific circumstances so that the use of it would remain poignant, with piquancy.
Was damn ever used in TOS as an actual expletive and not a religious reference? Might be TMP or WOK
TOS has a damn good example of it, yes. Thank Decker for one utterance, Kirk for two... McCoy still gets the filthiest pottymouth with the use of "hell", though Kirk's "Damn him!" moment regarding Spock comes pretty close too. Edgy stuck for "the motionless picture", no?
TWOK was definitely itching to do so as the D-word is used 9 times and the H-word counts up to 5, though seeing all the scenes showing blood spattered ended up having a little more weight as a result. I originally thought that one scene had intended "motherf..." but in a recent rewatch it's just murky acting of the comparatively kindergarten line of "Pin him down, mother!". TWOK also has the comparatively un-kindergarteny "You son-of-a-bitch!" by David reacting to Khan's line of "...captain" as if still thinking Kirk had given the orders (now that's a fun example of "confirmation bias" on screen,
squeeeeeeeeeeeeee!).
TSFS has bastard and son of a bitch,
Out of natural building up of extreme circumstances, rendering it poignant instead of being one of the following words shown below:
Context is part of it, as well as the believability of the moment.
Is there any other one before this?
Not many, which is part of the fun.
I guess "Jesus" as an expletive in First Contact if that counts.
Or stated by McCoy out of angst.
All in all, the rarity of such utterances only helps, given how much they're otherwise in control. Do it too much and it loses all depth, meaning, and even edginess.