This suggestion gives me chills. I literally never face this issue. Are you using vim? Theres autoindent and smartindent features you can enable to help you.
Neovim + ruff lsp. I have gone through many formatters to try and get this better, but it is always worse than any other language where whitespace is not semantic.
The one nice perk about the state of things atm in python is I can very easily filter out devs by their choice of python IDE (or lack thereof).