Where does Drupal set the uploaded file name syntax?
You can use transliteration module.

and in code use code like

function hook_transliteration_clean_filename_prepare_alter(&amp;$filename, $source_langcode) {
  $filename = drupal_strtolower($filename);
  $filename = str_replace('__','_', $filename);
} 


Above code is not tested, Hope it will help you.