My belief is that your first goal should be cognitive optimization. I.e. make it simple and clear. That includes using hash maps when that is the proper data structure since that’s is what is called for at a base design level.
The next step is to optimize away from the cognitively optimal, but only when necessary. So yeah it’s really crazy this was ever a problem at all.
OTOH, at some point what is good from a cognitive viewpoint depends on what idioms you use. So it can be helpful to actively chose which idioms you use and make certain to not use those that tend to blow up performance wise.
Given the current code example, I don't even thing idioms come into it. Here a hash map data structure was called for regardless of whatever idioms come into other parts of the design. This is just fundamental and has nothing to do with functional programming, OOP, etc.
The next step is to optimize away from the cognitively optimal, but only when necessary. So yeah it’s really crazy this was ever a problem at all.