Take a look at
/keybind
System tab
I checked the patch notes, but if this was mentioned there, I missed it. Prior to 4.1, the "Cancel" and "Close All UI Components" were one key that canceled, closed windows, deselected targets, and opened the Menu.
Now, they are two separate keys, and Cancel will cancel and deselect target, while Close All UI Components will close windows and open the Menu.
So you just need to remap your Esc key to "Cancel", and put some other key in Close All. Close All is compulsory; you cannot leave it blank. If you never open the menu, you can bind this to some absurd key combination like Ctrl+alt+shift+F9.
This is mostly a good change, as for those of us who never use the Menu, having it separate from the Cancel button is great because the Cancel button is now spammable, and does not open the Menu.
HOWEVER
Canceling a cast is, for reasons that escape me, now a function of the Close All button instead of the Cancel button.
I have submitted a bug report.