I am lucky to have found this Debian package https://tracker.debian.org/pkg/similarity-tester (source https://dickgrune.com/Programs/similarity_tester/ ) to help me detect plagiarism in my students's C++ code. The tool is perfect as it gives side by side comparison of codes to help see if there's a really an issue. Usually, it is easy to confirm by spotting specific constructions or even the positions of punctuation in code. I have found something for Python though.
During a RCA, you find a specific error message associated with that incident. You deliver a new alert with some documentation about what it catches and what to do. You even generate automatically a ticket when it is raised.
Time passes.
There's a subtle change if the error message. You have another production incident but your alert hasn't fired.
The complexity comes from this: how do you know that an alert is still valid without creating an incident on purpose ?
It is mostly about the fact that if the variable is not static, then it's non-local to the translation unit and can be modified from everywhere else. So its value needs to be loaded and a plain and slow division is applied.
Having it local or const makes the compiler able to inline it and do a simple bitwise and with a constant.
So yes, make your variables static const by default (if you really need global).