I would not recommend adding borders, for an Xivd file it's a waste of bitrate. Make it with a smaller horizontal resolution instead.
Similarly, I don't know if you would really want to crop - maybe that will happen when it's played back on a widescreen display.
The way I would do it it to modify the final line in the function:
return clp.lanczos4resize(720,ht)
replacing 720, ht with your desired width and height values. This assumes that if the source is interlaced that you have de-interlaced before Panorama.Obviously would you need to experiment to your own requirements, but for a start you could try a resolution of 640x384 (1.66:1) with strength 3.