I have macOS 15.7. I fixed this by going into recovery mode and reinstalling macOS. Don't worry about your files; macOS will reinstall while preserving all your data. Then Safari will be version 18.6 again and will work amazingly smoothly.
You can use macOS Recovery, your computer's built-in recovery system, to reinstall the Mac operating system. Reinstalling macOS doesn't remove your personal data.