How do I turn a shortcode into PHP code?

In general, inserting and executing shortcodes directly into templates files is not good idea and it is not what shortcodes are intented for. Instead, you should use the shortcode callback just like any other PHP function or template tag.

For example, let’s imaging this shortcode:

add_shortcode('someshortocode', 'someshortocode_callback');
function someshortocode_callback( $atts = array(), $content = null ) {

    $output = "Echo!!!";

    return $output;

}

Then, instead of doing this:

echo do_shortcode( '[someshortocode]' );

You should do this:

echo someshortocode_callback();

Obviously, to use the shortcode callback as template tag, the shortcode must be coded in a way it allows this use, so it may be not possible (although I’ve never found a shortcode that don’t allow the use of the callback directly, it may exist). In this case, and only in this case, I would use do_shortcode( '[someshortcode]' ) (I’ve never would use it really).

Note that shortcodes are PHP placeholders to be used where PHP code can not be inserted, that is why it has no sense for me to use them in PHP scripts.