And the best way to take advantage may be by unmasking the people that are incompetent enough to not assess others competence by looking at their work, and instead just look at their clothes.
But well, it's context sensitive.
You can't control others, you can only control your response to them. How people perceive you is a comprehensive and isn't always based in logic. You can use this to your advantage and take control of your own narrative or not. But you'll be worse off for it if you don't.
I think you'll be pleasantly surprised about what kinds of things people look favorably on.
Yes, I hear that a lot. Might as well push on a rope, though.
In my early career years, a fellow employee came to work in track shorts and flip flops. He was a very, very good programmer. But he never got raises, and never got promoted, and complained to me about it. I suggested it was the way he dressed. He said the same things you wrote.
A couple decades later, I ran into him again at a conference. He ran his own quite successful company. He also was dressed sharply.
Things that make you go hmmm....