What is the proper unreal way to open/close a menu widget with a keybind?

The Create a Pause Menu tutorial makes a fatal mistake in that the methodology it uses to hook up a menu to a keybind stops functioning appropriately unless the game is paused. The author specifically calls out the problem that the player can continue shooting / walking around when the menu is up, and sets the input mode to UI only to fix that, but then later calls out that this blocks the bound Action Mapping and prevents the menu from closing. To fix that, the author then changes the input mode to Game and UI. This is fine for the pause menu the author was creating because input is paused while the menu is open, but for nonpaused menus like inventory/etc the user can click through to the game and resume control of their character while the menu is still open:

Because we can’t restrict input to the UI alone since Action Mappings for whatever reason are restricted to the game (no one would ever need to process input with the UI open!), the only options I can see to lock down game input while the menu is open are:

  • Add a function to the player controller which disables the player’s movement. This isn’t portable, and it only accounts for a portion of input that may be active. We could build infra that all bindings in the game hook into, but that’s even less portable & it’s easy to introduce bugs where someone forgets to hook up a specific piece of input to this infra, and it will still be active while menus are open
  • Rather than using an Action Mapping, hook into key presses from the widget itself. This is also an awful option as input is split between open (game) and close (UI) for the same menu, and it gets rid of all of the benefits of Action Mappings: for instance, I need to hook up not only a keyboard key, but also a gamepad button, various VR controller buttons, etc all manually

For something that seems like such a fundamental use case (most games in my Steam library block game input while some sort of menu is open), I don’t imagine either of those two options are the best of what Unreal has to offer. What is the proper way to open/clause a nonpaused menu widget with a keybind while blocking game input?