I owned a 2006 S40 T5 until a UMass plow totaled it in 2017 with 187k on it. It was great to drive but after 150k miles I found myself spending about ~$1500 a year on repairs/maintenance. My brother-in-law has owned at least 5 of them dating back to the 240. After 80k miles or so you definitely want to have a local mechanic who specializes in Volvo. My brother-in-law drives 90-minutes to a specific garage in CT and I would drive 50-minutes to a specialist for mine. Really learned the hard way about needing a specialist because Volvo electrical systems are pretty advanced. For example, It took me hours of research and then taking it to three other mechanics, before the specialist figured out why I had no A/C in my T5. Ended up being if the outside temp sensor is bad it will not allow the A/C compressor to kick on to avoid damaging the compressor if run in cold temps. That occurred on mine at around 110k miles.
The preventative maintenance/repair costs do add up because parts are not cheap (e.g., a new alternator in a newer Volvo is usually $450-650 vs. $150-$250 for a GM or $250-$350 in a Subaru) and they are a pain to work on since they cram a lot in small spaces, so more money in labor charges. My brother-in-law's v60 is at about 160k miles and is usually in a shop 3-4 times per year for minor stuff that ends up being a good sized bill each time. They are safe, comfortable, fun to drive, and pretty reliable. That said, for me it is just not a long term vehicle due to the cost to keep up with it. if I were to ever get another Volvo I would get rid of it before 100k.
Edit: I always get the XC and V models mixed up.