Although the question title doesn't specifically mention SSH, though the body of question does, I came to this question looking for non SSH password removal, so perhaps this'll be helpful for both parties.
For Gitlab (& I assume Git) if you tick the remember box when entering your password for Android Studio Dolphin 2021.3.1 and you don't want it to be stored subsequently goto:
Settings > Appearance & Behaviour > System Settings > Passwords and then click the Do not save, forget passwords after restart button.

You then have to close and restart Android Studio, but then your password will be 'forgotten'
Obviously unclick the afore-mentioned button to have the behaviour reversed