I would say that your bosses advice was perfectly sound, and not something which should have been reported to HR. I do not believe it was sexist (although the wording may have been construed as such), he was just advising you to fit in.
It is no different, in my view, to advice given about how to dress for an interview. You dress smart, and in a way which will not cause anyone to see you in a negative light. This is easy for blokes: You go in a suit and tie, whether you are applying for a management post or a warehouse job. For women, there are more choices, but you go in work-smart clothing, not exposing yourself, not tarted up to the nines...
When it comes to work, as others have said, try to fit in. If everyone else is wearing suits, you wear suits. If everyone else is wearing shabby jeans, ditto. You don't want to stand out until you have established yourself, at which point you need to be sure you stand out in a positive way.
So, although I will not deny that things are more difficult for women in a technical profession, the advice about dress is something everyone needs to take on board.
As for the "acting like a bloke" bit, well, that'll cause me some issues at some point. I'm a quiet bloke, and I hate to sing my own praises or push my way forward. Luckily I have never had to, and my bosses have always been able to see my good work without me shouting it.