Performant slice method for array-like objects