Mamdani can be a good pragmatic example, wish him the best, but he’s limited to the Senate at the federal level if he aspires to higher office.
Mamdani could still be the president. The Constitutional requirements for being president are pretty weak and easily bypassed. You can have someone else officially run, and they run on the platform, "I'm going to hold the pen and do whatever this guy tells me to." You select someone who would have no political legitimacy on their own, so they're completely dependent on the real power behind the throne. If Trump decides to run in 2028, this will be the mechanism he uses. But Mamdani or Obama could use the same mechanism if they wish.
The Constitutional limits on presidential eligibility are pretty trivial to bypass.