RPGs are inherently optimistic because they actually feature character progression unlike real life
Indeed. Regardless of the story, the setting, the choices, there is always the expectation of unhindered character advancement. Even under the worst circumstances, you will be expecting a level-up or otherwise gain skill/ability increases at some point and the games will fulfill that expectation. That your character will statistically grow without any hindrance is an unspoken promise.
Your character will make friends, lose friends, suffer wounds, have near-death experiences, suffer tragedies and yet, nothing of any of this will reflect on your character sheet, on your stats and on your choices. At most,
some games will let you choose some disadvantages during character creation in exchange for other advantages but your
character will never suffer anything, lose anything. You don't
gain permanent disadvantages as a consequence of events befalling you. There are maybe only a handful of examples of this happening ever, hardly with any real significance.
The story, the setting, writing, all the best of it simply manipulate your emotions
as the player and do nothing for your character. Therefore, RPGs are inherently optimistic on a mechanical gameplay level.