Need to force inventory cache usage past timeout

I’m working on converting the old cobbler inventory script to an inventory plugin. See https://github.com/ansible-collections/community.general/pull/627

The behavior that I last had with my last version of the inventory script was for it to fall back to the cached data regardless of the time since last update if it could not contact the cobbler server. This allows for ansible-pull to work off of our internal network. However, with the use of cache plugins (jsonfile in my case) I do not see a way to achieve this. Any suggestions?

This is what I've come up with:

             self._options['cache_timeout'] = 0
             self.load_cache_plugin()
             self._cache.get(self.cache_key, {})

seems to work.

Well, not quite. Due to the bug mentioned below I ended up with:

       # Work around https://github.com/ansible/ansible/issues/70702
       self._options['cache_timeout'] = sys.maxsize