Open
Description
When bool_array has many axes and many True values, this can be very slow. This is due to the computation of the target_axes (because this involves combining labels, which is very slow).
It is necessary to do it so that we can broadcast "value" correctly (and check its axes match the target), however there are cases where we can avoid it.
For example, if value is a scalar, we don't need to compute target_axes. More generally, when value does not have any of bool_array.axes, computing target_axes using wildcard axes would be enough.