Is it possible to add a wildcard in template.php to apply function to multiple items
This seems more like a general PHP question, but I'll answer it anyway with some Drupal context.

You usually loop through the array in these instances. You'll find looping as you code in Drupal more and more common.

Consider the following structure:

$form['submitted']['products']['product_1']['quantity']['#empty_option']


Assuming that you're editing the ['quantity']['#empty_option'] of each [product_x], you loop through your array like so:

foreach(element_children($form['submitted']['products']) as $key) {
  $form['submitted']['products'][$key]['quantity']['#empty_option'] = t('Qty');
}


element_children gives you the keys for the array which don't start with a hash #. Whether or not it's suitable for your particular array is a different matter. You can inspect your variable using var_dump($variable) or through Devel module's dpm($variable, 'label'); function.

You may find that you may need to run some if statements to test if $key starts with product_ if you have more than product_x keys under $form['submitted']['products']

foreach(element_children($form['submitted']['products']) as $key) {
  // Only proceed if array key starts with product_
  if (substr($key, 0, 8) == 'product_') {
    $form['submitted']['products'][$key]['quantity']['#empty_option'] = t('Qty');
  }
}