I’ve just read through this thread as a curious observer. One thing I found odd is that so much of it was focused on performance benchmarking, which to me seems like it should be only a 4th or 5th level concern for this code. Correctness (in single and multiple threading contexts, and re-entrancy) and simplicity of maintenance at least are two much more important goals.
As for whether this “just” “shifts the work” of bookkeeping to the dict code - I should think that would be universally accepted as a good thing. I don’t understand the argument for why that would be bad.
I greatly appreciate @iritkatriel for pointing out that we want to encourage people to run experiments, even on code that we think may be “solved”.
Finally - the suggestion seems to be that an API addition to the dict code might be a more tenable path. I very much doubt that if the OP had come here saying “I have some API additions to dict that I’d like to make, which would simplify some toy caching implementations I’ve been playing with” he’d have been greeted any more warmly. That seems quite a bit less promising as an opening move than “I have a simplification of existing code that also happens to be faster.”
That said, I would definitely welcome those specific dict additions, because I have badly wanted them in the past. So +1 from me on that.