I remember playing a game like this when I was a kid (25ish years ago) at school, except it wasn't golf, but rather a two player game where you shot gravity-assisted missiles at each other (think Worms-in-space). I remember it being on an Acorn Archimedes, but it may have been a PC.
It was called !Gravity on the Acorn Archimedes. It was written in BASIC (and possibly some assembler) and I remember it being a popular game at school to hack - change the number of planets, acceleration rate etc.