Indeed, I've never used this class in a performance-sensitive environment, and I certainly recognize the potential issue here. It's a shame there's not a better construct, because any other construct is going to require multiple lines of code and have to reference `key` twice (check then set).

I'm slightly inclined to keep the more elegant code for readability, but then again, I don't have anything that depends on it being super-efficient.

Kinda makes me wish dicts had a 'set_default_late' method or there was a setdefault expression that would late-evaluate a given expression only on set. Oh, well.

I'm happy to go with whatever your preferred approach is on this.