Green’s Dictionary of Slang

razor n.1

1. (US campus) a pun.

[US]Yale Tomahawk Nov. in Hall (1856) 385: The meeting will be opened with razors by the Society’s jester.
[US]B.H. Hall College Words (rev. edn) 385: A pun, in the elegant college dialect, is called a razor, while an attempt at a pun is styled a sick razor.

2. a notably ‘sharp’ person.

[US]R. Klein Jailhouse Jargon and Street Sl. [unpub. ms.].
OnLine Dict. of Playground Sl. 🌐 razor n. stylish f. another word for stylish is ‘sharp’, so razor implies someone extra sharp.

SE in slang uses

In compounds

razor ball (n.)

(US black) a dance frequented by tough patrons that is likely to degerate into a roughouse.

[US]W. McTell ‘Razor Ball’ 🎵 Down at the razor ball given at the Razor Hall / Sluefoot Mose and old Cross-Eyed Joe didn’t go in at all / [...] / Joe got drunk, that wasn’t all, went and turned out the lights, / And that markshootin’ Charlie shot his automatic twenty.