I typically ride stuff I buy “out of the box” until something wears out or until I decide it really doesn’t work for me OR I’ve built it from the spares box (a bit of a hobby in itself for me).
I put decent pedals on my recent new bike straight away (resin with clips and straps isn’t really the way to go) and did the tubeless conversion on the wheels a few days later (blooming brambles).
Things I would change early on if I didn’t get on with them:
– saddles
– tyres (if totally inappropriate).
– stem or bars (for reach/comfort)
I think in part it depends on your attitude and how you go about it.
I know people who’ve bought a bike with the sole intention of only getting the frame out of the middle because their accumulated over the years kit is super bling and buying a frame only is poor value. With the right discounts I’ve seen one friend end up with a free frame (albeit including selling their “old” one). With ever changing standards I can see this being less easy.
Equally if you’re on a budget you could buy the base model and deal with some critical weak points straight away and flog off the shiny new unused OEM stuff and minimise your losses.