I usually just don't react, repeat what they said back to them, and they ask if I'm R slur and then I repeat what they said again for confirmation. Usually they walk away. I don't have the energy to engage people at work on any level beyond telling them where stuff is.
I also wear a mask at work so usually they don't even bother talking because they assume I'm a blue haired woke lib.