They've been idiots about my electric toothbrush before, which resulted in a comment that suggested the particular blueshirt must be unfamiliar with toothbrushes, judging by the smell of his breath.
There's nothing about an electric razor that would make it prohibited, and there are no limits to the depth of stupidity at the TSA.