How can you stop sites from sending unwanted or 'enforced' downloads in Safari?
The real solution is upgrading to Safari 13, but there does exist a solution on Safari 12 and earlier.
Open Safari Preferences, choose the General tab, and for the download location choose ‘ask for each download’.
With this option select, Safari will prompt for a file name and a location to save the file, which you can cancel so the download doesn't take place.