This is the first commit of #31132, which can be merged as an independent change. It has a small benefit on its own, but will help in moving the parent PR forward.
Add a Reset() method to CCoinsViewCache that clears cacheCoins, cachedCoinsUsage, and hashBlock without flushing to the base view. This allows efficiently reusing a cache instance across multiple blocks.
Add CCoinsViewCache::CreateResetGuard method to return a CCoinsViewCache::ResetGuard. The ResetGuard automatically calls Reset() on destruction. This RAII pattern ensures the cache is always properly reset between blocks.
Add m_connect_block_view as a persistent CCoinsViewCache for ConnectBlock, avoiding repeated memory allocations.