prepare the slice with the correct capacity but keep len 0 to avoid allocations later