I mean, it's pretty clear that sun exposure damages the skin. And it's not just skin cancer but other pre-cancerous changes and just premature aging.
https://www.msdmanuals.com/home/skin-disorders/sunlight-and-...
That article isn't strictly wrong to say that exposure to sunlight is linked with melanoma, but it's linked to childhood sunburns and intermittent sunshine/sunburn. Sunburns are bad, sun is good.
> And perplexingly, outdoor workers have half the melanoma rate of indoor workers. Tanned people have lower rates in general.
I think it's also fair to say that exposure to the sun doesn't cause premature aging so much as not being exposed to the sun makes you look younger than you would otherwise - but of course that only helps if you're alive. Direct sun exposure reduces all-cause mortality. [1]
Which is not surprising considering the need for sun exposure for things like vitamin D.
But I'm not sure mortality is the best measure? Maybe quality of life? Getting surgery to remove a basal cell carcinoma and having failed skin grafts (happened to my grandmother) seems like a heavy burden to cost of life not captured in mortality.
https://pubs.rsc.org/en/content/articlelanding/2002/pp/b2012...
Vitamin D production is highly dependent on time of day and latitude. At latitudes closer to the poles, even extended sun exposure might not stimulate much vitamin D. You can find online calculators which show this for your location.