Just cut down the buffer tube and reattach the butt stock closer to the receiver to recreate a collapsed butt stock.
This is an aftermarket butt stock but you’ll get the idea. Extended (note buffer tube)
Collapsed:
Edited to add:
The Government issued M4 butt stock shows more of the buffer tube adjacent to the receiver than this aftermarket one does when collapsed.
Got ambitious and dug through the spare parts