Are you building or modifying the trailer yourself ?
How about rounding off the front of the trailer so it matches the cab for width and height ?
Any lost volume due to that could be taken up by increasing the length in a place where the cross section is far larger, and the space more useful.
You could use top and side plates on the rear of the cab to (almost
) close the gap to the trailer, while not making the tow vehicle wider or higher.
It wouldn't impact the towing vehicle when used alone.