Similarly to what we did in https://github.com/llvm/llvm-project/pull/152691, we can perform an optimization for `std::map` and `std::set` when inserting a range of iterators.