Something about taking prostitutes on voyages across the sea in the olden days. You’d romance her under the cannons and the bastard child would be a “son of a gun”. I don’t remember where I learned this so feel free to correct me if I’m wrong.
Edit: I looked it up and got some details wrong, but pretty close
Rocky 3 (1982)
Akira (1988)
This is England (2006)
Planet of the Apes (1968)