C implementation of Python 3 lru_cache