If you're on windows you can easily turn them off with inspectre from grc [1]
There are more granular parameters that are supported by all kernels implementing CPU mitigations: noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off mitigations=off
https://unix.stackexchange.com/questions/554908/disable-spec...
I do lots of compiling at work and our compiler hasn't changed in 5+ years.
pre spectre my 8700k could do 20k lines/sec. Post spectre with mitigation it's about 10k, with them disabled it's about 15k.
There's clearly been some under the hood changes to windows beyond these optional? changes.