I was just about to comment about Stoicism!
I try to be a stoic, and the goal isn’t to passively endure the endless awful things that will happen but rather accept that there are bad things that will happen, but that spending a lot of energy worrying about the chance they might is a waste of time. For me it’s a kind of optimism (as close as I’m likely to get). That may sound bleak, but honestly it’s not.
I have to wonder how these studies measured optimism or pessimism, and if that is even the right question. I suspect it has more to do with whether one is focused on the present or the future (as in worrying about the future, or looking towards a future when everything will be much better than now).