Getting rid of password_confirm labels in module
I agree with @Clive that it is not a good idea to remove those labels, but there is a way to make them invisible, without to remove them. Drupal 7 has a CSS class for that purpose: element-invisible.

The code I would write is similar to the following one.

function mymodule_form($form, &amp;$form_state) {
  $form['password'] = array(
    '#type' =&gt; 'password_confirm',
    '#maxlength' =&gt; 20, 
    '#size' =&gt; 10,
    '#process' =&gt; array('form_process_password_confirm', 'code_testing_process_password', 'user_form_process_password_confirm'),
  );

  return $form;
}

function mymodule_process_password($element) {
  $element['pass1']['#title'] =  '&lt;span class="element-invisible"&gt;' . t('Password') . '&lt;/span&gt;';
  $element['pass2']['#title'] =  '&lt;span class="element-invisible"&gt;' . t('Confirm password') . '&lt;/span&gt;';

  return $element;
}


The process functions I am using are the same used from the "password_confirm" form field, except the second one, which is my custom process function I use to make the label invisible.

You could also replace the reference to form_process_password_confirm() if you want to radically change the output for the form fields. The last process function I am using is the one that adds the JavaScript code which checks when the password entered in the two form fields is the same, among other things.