If plan everything out, I might be able to create specially-sized compositions.
Lemme think. For the 40x22.5 example, I pad the bottom with 16 extra pixels and make a composition that's 1280x736 and then divide it into 40x23 using the mosaic filter. And so the bottom row doesn't end up darker or translucent, I have to double-up the footage so the bottom 16 pixels are repeated twice.
That should work, it'll just take time to set up each special size properly.