I slouched a ton in school but started doing the 'strut' sometime during adolescence. As my independence came about I started standing straighter and look more alert around other people to put them off messing with me. (Because they did mess with me). I did wish to hide the chest and strutting doesn't necessarily help establish a sense of threat if people think you look female, but I've never been good at hiding or making myself look small so what the hell I look sure of myself instead. As much as I hated the rack I'd still wander about with a slight swag walk and bolt upright which no doubt looked utterly bizarre to everyone else.
Part of it comes from social anxiety, looking inconspicuous never helped me because I was regularly jumped by hordes of kids all through childhood who'd try to beat me up and wreck my bike etc. at which point I had this - I dunno what you'd call it. When someone just has enough and they snap. Well that was me. After years of it I took a baseball bat and went right into the kids' turf and challenged them to a broken face. After that point, I no longer could just walk around being scared, and radiating terrified body language so I started doing the opposite with the shoulders back, chest out sway thing. People did seem to not want to come near me a lot more than before. Which was good. So there was some positive reinforcement of that behavior in my brain, and the slouching wasn't reinforced.
I do remember wondering what to do about the chest, but found that certain clothes and jackets hid it all well enough.
At the moment I don't slouch except when I'm on my couch, lol. When I'm outside I ALWAYS have this heightened sense of awareness, and I walk straight, probably because of those early years being jumped by kids every time I dared go 100 yards from my house. The more people that are around when I'm alone, the straighter I walk, probably. I did think I might have damaged my posture in school, but due to a current condition as well it's actually the most comfortable to keep my back very straight. (Not sure what the condition is called but if I sleep for too long I wake up with the worst back ache. Once I stand up, I'm fine).