Can you shorten class B water heater vent pipe?
The short answer is no. B-vent cannot be cut.


But there is hope. You don't have a joint in the straight run but you do have two 90s


This shows a B-C adapter with a C vent 90


C vent isn't actually a thing, it's just what people called regular venting.

Everything below the B-C adapter is fair game you could potentially remove the B vent 90s attach the B-C adapter to your straight run and then use C vent the rest of the way. C vent 90s are smaller and easier to work with. You can even trim up to the rivet to buy some space. 


Without a picture it's hard to say what will work but there are 12" flexible sections of B vent available.

12" B vent flex

www.amazon.com


Unfortunately they are proprietary. You would have to match it. But 1 12" flex could buy enough space if you replaced the two 90s with it. (again pictures would help.)


The last tactic in the arsenal is pushing it up through the thimble. This will require going on the roof.

B-vent chimneyHart and cooley


Before you push it up (if necessary) you will need to make sure there are no screws going through the flashing into the B vent (you don't want to disturb your flashing) they might be hiding under the storm collar. The firestop (if equipped) may also have screws in it. That would pose a problem. They would also need to be removed. Once it's pushed up reattach the storm collar back just above the flashing. 

Hopefully method number one works. You may need to do a combination of all three.