How to implement custom theme functions (theme_textfield, theme_form_element) for some forms only?
Those theme functions don't get a reference to the form where the element is used. Therefore, they cannot be used to alter an element for a single form.

Every form element accepts #theme, so you can alter the #theme function used for those form fields in a single form. This is what Drupal does in node_filter_form().

  $form['filters'] = array(
    '#type' =&gt; 'fieldset',
    '#title' =&gt; t('Show only items where'),
    '#theme' =&gt; 'exposed_filters__node',
  );


theme_exposed_filters() then does its job.

  $form = $variables['form'];
  $output = '';

  if (isset($form['current'])) {
    $items = array();
    foreach (element_children($form['current']) as $key) {
      $items[] = drupal_render($form['current'][$key]);
    }
    $output .= theme('item_list', array('items' =&gt; $items, 'attributes' =&gt; array('class' =&gt; array('clearfix', 'current-filters'))));
  }

  $output .= drupal_render_children($form);

  return '&lt;div class="exposed-filters"&gt;' . $output . '&lt;/div&gt;';


Unfortunately, this doesn't work with theme_form_element() or theme_form_element_label().