> Alt+tab is an optimal controller.

Having to iterate through your windows is not optimal. I use sway, with windows divided across workspaces. So if I want to switch to my web browser I hit super+1. If I want to switch to my code editor I hit super+2. If I want to switch to my terminal(s) I hit super+3. I use 4 through 0 for other random windows (for example, I usually launch games or videos on 0. If I'm working in two code bases I generally put the editor and terminal for the 2nd code base on 4 and 5).

What takes you O(n) takes me only O(1).

Standard out-of-the-box Windows behavior: quick Alt-Tab press switches between last two windows; pinned apps on taskbar are switched with Win-1..9 shortcuts.

press alt, tap tab, click the window you want

If you're going to go all the way to the mouse, you could just... click the window you want.