seems this duplication can be avoided by reducing the if to `if overwrite: x = arr1d.copy() else: x = arr1d`