I've used WD-40 in the "Process" of cleaning my firearms, since age 18 or so. I buy it in the gallon can at Home Depot and pour it into a pump spray bottle, much cheaper, lasts longer. I use it as a "flush" to rid residue, grime. Much like the OP did on his razor. I "always" finish with a quality oil/lubricant. I have 12 AR magazines that my little brother gave me, used in various deployments and in rough condition. I will flush and scrub them with WD-40 first.
For me Wd-40 has been a wonder fluid with many uses. You just have to be aware of it's properties/limitations.