Jeez, I thought these auto opening usb things were isolated to Windows and only old versions. What’s the story with this on macOS?
That's exactly what's happening there, but the "keyboard" is pre-programmed to enter keys presses automatically in a way that makes a website pop up.
You can't really prevent that.
I don’t know that people would accept this inconvenience, though.
how would you accomplish this given that the normal situation is that you're plugging in a keyboard?
This is somewhat similar to how bluetooth keyboards are enabled on macOS (or were the last time I connected one).
All kinds of legitimate (well, this is legitimate too really, it's just weird) devices have similar behaviour, and in their cases it's what the user expects and wants.