Both versions of this to work with `List<T>, Array[T], Span<T>, ReadOnlySpan<T>` and `IReadOnlyList<T>` If the source is null or empty, then default to creating an array so that max speed is maintained.