Take flattened array views to avoid some copies
Take flattened array views to avoid some copies

Make use of Numcodecs' `ensure_contiguous_ndarray` to take `ndarray`
views onto buffers to be stored in a few cases so as to reshape them and
avoid a copy (thanks to the buffer protocol). This ensures that
datetime/timedeltas are handled by default. Also catches things like
object arrays. Finally this handles flattening the array if needed.
All-in-all this gets as close to a `bytes` object as possible while not
copying and doing its best to preserve type information while
constructing something that fits the buffer protocol.

zarr-developers/zarr-python,alimanfoo/zarr