Functions that I write like
each one presents data in different amounts and different way and there is no reason to waist CPU on running all of them if my customer will only use 1 out of all them in the template.
Presumably there will be a list of allowed variables and functions for template to be able to access and then template would start with requesting run of function and then use variable/array from that function like this:
My vote goes for Smarty as well, it is one of most popular (and I belive very secure) templating system. I have build dozen of sites with it. I have heard that in some last projects people use Savant3 as well - I did not used it personally but it may be worth checking.