As a little example, here’s the original patch from Julian Eisel to hide the 3D cursor, which gots declined in those days https://developer.blender.org/D1110
This functionality now made it after many years into newest Blender version. It’s now in the User Preferences. And is different implemented. You could grep this one to its roots.