Even
that isn't certain. Composting results in the emission of greenhouse gases too - most notable methane which is a 25x stronger GHG than CO2. Best-case scenario, it'll decompose into CO2. But then you have to look at the actual product. Plastic coffee cups are really flimsy, and compostable cups seem to be quite a lot sturdier. When it is getting turned into CO2 anyways, it is better to use a cup which uses less overall material - which would mean a plastic one. A similar argument applies to paper packaging: just because you can recycle or compost it, doesn't mean it is actually good for the environment.
The main goal of reducing single-use plastic is to deal with people just throwing it away on the street or in nature, resulting in animals trying to eat it and dying. When it comes to climate change, using plastic and simply incinerating the waste is probably the better option.