How to remove the size attributes of all fields?
For text fields the size attribute is forcibly added in theme_textfield(), so the only way would be to override that function in your theme and remove that bit of code:

function mytheme_textfield($variables) {
  $element = $variables['element'];
  $element['#attributes']['type'] = 'text';

  // 'size' removed from this call
  element_set_attributes($element, array('id', 'name', 'value', 'maxlength'));

  // add the rest of the function...


Exactly the same thing goes for the file element (see theme_file()), and most likely for any other element type you need to do do this for.