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.
Introduce m_connect_block_view as a persistent cache layer for ConnectBlock, avoiding repeated memory allocations. On block validation failure, Reset() discards uncommitted changes without affecting the main cache.