The best practice answer is: if your view requires variables, make sure you pass them. If your view has optional variables, use isset() before you access them.
if you need a global function to do
isset($var) ? $var : 'default'
the best place to define them is in you application bootstrap.