MNT: More memory efficient binary_mask creation