Best practice for language key for "und" in hook_form_alter I'm modifying in a form in my custom module. Code looks like:

function my_module_form_alter(&amp;$form, &amp;$form_state, $form_id) {

    if ($form_id == "someID") {

        $form['field_charity_author']['und'][0]['value']['#value'] = arg(3);
        //$form['field_charity_author']['#type'] = 'hidden';

    }

}


However, I think hard-coding und is bad. What should be the proper way to modify form fields properly in this case?
Unfortunately, your self-answer is not so universal. Field language and node language are not the same things.
Field language is needed only if you are using Field Translation API (for example Entity translation). When you start using it, some fields are converted to translatable.  

Translatable fields have language code, which really makes sense. But if the field is not translatable, the language code will always be (and for all content types, entities, etc) — LANGUAGE_NONE (best to use the constant LANGUAGE_NONE and not the string 'und').
So with your solution you can get a situation when a node is Russian, but a field of the node uses LANGUAGE_NONE.
Happily, fields are attached to the form with '#language' key, which always contains the correct language code.  

$lang = $form['FIELDNAME']['#language'];
$form['FIELDNAME'][$lang][0]['value']['#value'] = $value;


If you have no access to attached form, Field Language API functions can be useful.