Form API will happily ignore any fields not defined in the form array. It's a bit ugly but I'd look at the posted values in #post only to see how many fields I need to define and I'd define that many. This, of course, in D5.