MDL-38555. I noticed the bug while working on MDL-75083.
With Safari it is (sometimes?!) possible to double submit Moodle forms. The submit button is not disabled as it should be after the first submit. This can be tested by creating a forum post for example.
A little more testing and added debug output to the submit.js showed that the problem is caused by a race condition between the beforeunload event fired by the browser and setTimout(function, 0). Looks like Safari is a little slower than other browsers firing the beforeunload event. See the attached screenshots.
Tested under macOS Big Sur (11.6) and Safari 15.0 (1666184.108.40.206.4, 16612)