Easy functions for copying slices to avoid memory leaks