Is there a way to pass arguments to WordPress template (w/o get_template_part())

So, I need to pass arguments to WordPress template (e.g. index.php or single.php) like this:

<?php
/**
 * File ./single.php
 *
 * @var string $foo
 * @var int    $bar
 */

echo $foo; // like that?
echo $bar;
echo $args['foo']; // or maybe this way?
echo $args['bar'];

Just to clarify: I DO NOT need to pass that arguments to get_template_part() function, I need them in “main” template, that loads up via WordPress template hierarchy. If I get this correctly, the only step before template renders that I can affect on is functions.php. So, is there a way to pass arguments (to satisfy MVC conception better), or should I use some functions, methods, maybe do_action() and apply_filter() hooks?