Clear example on how to use #theme for form API
You're so close...the name of the render element is arbitrary, it's just a name so you can pick it up at the other end. Or, put more eloquently:


  The name of the renderable element or element tree to pass to the theme function. This name is used as the name of the variable that holds the renderable element or tree in preprocess and process functions.


So:

function MYTHEME_theme() {
  return array(
    'custom_func' =&gt; array(
      'render element' =&gt; 'my_element',
    ),
  );
}

function MYTHEME_custom_func($variables) {
  $element = $variables['my_element'];

  // Use the values in the $element render array to build markup.

  return $element;
}