I used a piece of expanded PVC to shim a door I installed 3 years ago and it has been fine. However, if I had known it was XPVC when I bought it, I would have used something else. I had to mortise in hinges and it machined with no trouble.
I wouldn't recommend it but it works if you must use it. As for a general wood substitute, how are you going to glue it, regular woodworkers glue isn't going to stick, so you'll have to use ??epoxy??
My application is not exposed to sunlight so UV is not an issue. In addition to discoloring, UV makes PVC brittle causing it to fail easily.