The basic idea with this patch is to setup a clean way to keep the navigation gizmo visible during modals without changing if/when other gizmos are hidden.
To do that, I added another value to the View3d.gizmo_flag enum that's specifically for hiding gizmos during modals, swapped out V3D_GIZMO_HIDE for V3D_GIZMO_HIDE_MODAL in those relevant modals, and added new poll functions to a handful of gizmos that were previously using ED_gizmo_poll_or_unlink_delayed_from_tool() as a generic poll function. The navigation gizmo stays visible, since it doesn't look for V3D_GIZMO_HIDE_MODAL in its poll function, while the rest of the gizmos do their usual things.
My thought process behind approaching it this way is that I didn't want to change the meaning of V3D_GIZMO_HIDE, and I wanted avoid any secondary effects that would come from not setting a hide flag at all during modals. Doing it this way lets me lay some groundwork for T63743, as I don't see a way to solve that particular problem without adding a similar flag.