PERF: better perf on _ensure_data in core/algorithms, helping perf of unique, duplicated, factorize
xref #16043 

```
   before     after       ratio
  [6f525eec] [3cc49f80]
+   82.43μs   115.72μs      1.40  timeseries.DatetimeIndex.time_unique
+  120.41ms   161.89ms      1.34  frame_methods.frame_duplicated.time_frame_duplicated_wide
+    7.78ms    10.43ms      1.34  groupby.GroupBySuite.time_unique('int', 100)
+   12.13ms    15.91ms      1.31  groupby.GroupBySuite.time_unique('float', 100)
+  707.18ms   916.55ms      1.30  groupby.GroupBySuite.time_unique('int', 10000)
+     1.24s      1.49s      1.20  groupby.GroupBySuite.time_unique('float', 10000)
+  400.17μs   448.59μs      1.12  groupby.GroupBySuite.time_nunique('float', 100)
-    8.64ms     2.46ms      0.28  period.Algorithms.time_drop_duplicates_pseries
```

so lowers the diff with 0.19.2 a bit.