def _cache_key_func(system, method):
    """Construct cache key for a given system and method pair."""
    if not isinstance(method, str):
        method = method.__name__
    return (f"{type(system).__name__}.{method}", id(system))