I think several different things are mixed together here. "Eating a cookie won't hurt me, because it's only 100 calories" is not fallacious, taken at face value it is valid. Bringing in "broader context" is called the slippery slope argument, and at least traditionally doing that is considered fallacious. However, there are pragmatic defenses of the slippery slope in policy debates, see Volokh-Newman's In Defense of the Slippery Slope:
"To accept a slippery slope argument, detractors claim, is to say that “we ought not to make a sound decision today, for fear of having to draw a sound distinction tomorrow. It turns out, though, that the realities of the political and judicial processes can make the slippery slope — or, more precisely, several different kinds of mechanisms lurking behind the label “slippery slope” — a real concern... But arguments such as “Oppose this law, because it starts us down the slippery slope” have earned a deservedly bad reputation, because
they’re too abstract to be helpful... What is valuable is the ability to identify ways in which slippage might happen and to tell listeners a plausible story about how this first step might lead to specific other ones."
Argumentation theorists concur, with similar reservations, see Kelley's Art of Reasoning:
""slippery slope arguments can be good ones if the slope is real—that is, if there is good evidence that the consequences of the initial action are highly likely to occur. The strength of the argument depends on two factors. The first is the strength of each link in the causal chain; the argument cannot be stronger than its weakest link. The second is the number of links; the more links there are, the more likely it is that other factors could alter the consequences.""
The difference in the last two examples is that the "broader context" is already present, it is not something that may or may not occur in the future. They both invoke reasoning from the continuum fallacy, a.k.a. the sorites paradox (paradox of the heap): adding a grain to a non-heap does not make it a heap, therefore no amount of grains makes a heap. Or, therefore no one grain "contributes" to the heap. Here we have votes in place of grains. The reasoning ignores qualitative transitions in chains of small increments, which the media often dramatize by pointing out how in close elections a handful of votes would have changed the outcome.
The second example, unlike others, also has a "should", which brings in yet another issue, see What fallacy argues that we should do nothing because we can not do everything? "We can not solve it perfectly, so why bother at all". The names are the perfectionist fallacy and the perfect solution or nirvana fallacy. It creates a false dichotomy between perfection and doing nothing, and then dismisses not doing nothing as imperfect. This second part involves the fallacy of relative privation, see What fallacy dismisses problems by presenting "bigger" problems?
Even aside from this particular context, deriving a "should", what to do, from what is is problematic in itself on general grounds, see the naturalistic fallacy or Hume's is-ought guillotine. One could say that we should do what is right even when it is "pointless". But one can reconstrue the inference as an elliptic means-end reasoning: we should mitigate climate change, so we should reduce greenhouse gases as a means (in principle). But since we can not reduce them by much we shouldn't bother. The first part is now valid (assuming one accepts the scientific connection), but the second one is soritic.