This is #18985 rebased, with the most recent comments addressed.
We can avoid many unnecessary std::vector allocations by changing CBloomFilter to take Spans instead of std::vector’s for the
insertandcontainsoperations.
CBloomFilter currently converts types such as CDataStream and uint256 to std::vector on
insertandcontains. This is unnecessary because CDataStreams and uint256 are already std::vectors internally. We just need a way to point to the right data within those types. Span gives us this ability.