One thing I will note is that the markups have been a lot less in practice than claimed since Apple stopped using PowerPC. Most of the people I know who did comparisons ended up finding the Mac either equivalent or, frequently, cheaper once they adjusted for equivalent quality. Sure, you can buy a $400 PC but you end up buying 3 of them over the same service life and have a shoddy display for that entire time. The bundled crapware PC vendors use to subsidize the low-end stuff is really not helping the impression of their products, either (I know multiple people who had an unusable system out of the box that way. They now use Macs.).
The mistake is buying a $400 laptop. Although anecdotically I've known a lot more people whose MacBook has died than PC laptops.
27 inch iMacs had easily accessible ram upgrades until they were discontinued. 21.5 iMacs (post 2012 refresh) did also have upgradeable ram, but it was a pain to do (dimm slots were on the back of the main logic board, meaning you essentially had to remove every other component and the logic board).
2012-2015 MBP Retinas could have the storage upgraded because it was a discrete SSD. I think they were largely proprietary or specially made, but they could be upgraded.
MBAs up until 2017 could also have the storage upgraded.
I wish that ram was upgradeable on apple silicon systems, but I understand why it’s not (I assume it’s an integral part of the SoC).