Sounds good, here's an updated patch that uses frozenset instead. I also moved the lru_cache imports up with the other system imports and renamed use_reduce_cached to _use_reduce_cached to fit with the existing convention.
Memory usage and performance are essentially unchanged due to the tuple to frozenset change. Thanks, Chun-Yu