I think that I would prefer that when there is no cache, a joblib.Memory object with cachedir=None is returned. This object doesn't cache anything, but it ensures a uniform behavior of the code.