core: add explicit capacity hint to collect, from_iter, and extend