Using custom functions in Views template files = not good practice?
This should be just fine, however, The REAL Drupal way to do this, would be for your module to provide a field formatter to views that calls this function. There are many modules which do nothing but provide functions. CTools, for example. 

Having a field formatter removes your site's functionality from the "view". Which is a best practice with any kind of software. You'll be able to change the theme in the future without worrying about your youtube IDs. Creating a formatter isn't hard to do, here is a great tutorial on how to do it.

Once you have a formatter, you can simply select it from the drop down in the View's UI and you're done!