I wonder how often it is called with nil vs an empty map?
Feels to me like this is an edge case that -- if the application code is a hot path when passing nil -- the application code should have the guard on nil.
Otherwise, every user and every call now has to pay the tax of that extra if in all cases.