A very large proportion of xarray's code goes through xarray.core.computation.apply_ufunc, which is also exposed publicly for advanced users to wrap their own ufuncs.
Internally if a dask array is present then we call dask.array.apply_gufunc - perhaps cubed should expose a similar function in the same way that it exposes map_blocks etc.?
xref pydata/xarray#6807