You can be optimist about your goals but pessimist about your means. There's probably any number of quotes from military strategists about that kind of thing.
You can do the same thing in reverse with "optimism" by pinning that term to an extreme version of it, which is obviously going to be wrong most of the time, while making "pessimism" the milder outlook that happens to align better to reality. Straw-manning, basically.