Is your feature request related to a problem or challenge?
#15384 reverted an optimisation that was made in #11638. I believe there's a simple fix for the original problem that doesn't throw out the optimisation by avoiding evaluation of either the then or else expressions when the when vector is either all true or all false.
Describe the solution you'd like
No response
Describe alternatives you've considered
No response
Additional context
No response