REF: implement nested_data_to_arrays
In the next step, I plan to use this in the relevant case for ndarray, which we currently treat differently from EA.

Categorical edits are unrelated, just sneaking in.