What is the best way to test if a file exists without knowing which file extension a Craft install is using for templates?
That's exactly how I'd do it.

It doesn't make much sense, but there's nothing stopping a user from having both extensions for a template like:

/index.html
/index.twig


And your existing code would cover both cases.