The idea of a theme should be to somewhat make the idea of skinning and changing the layout of a website easier. When you've got functions defined within a theme and then other PHP code, it's indicative that there needs to be a structure within PukiWiki which handles code blocks rather than just using PHP code inside the theme.
An idea would be for instance, a database object such as $theme, which contained various predefined blocks of HTML code which would be printed when the object be referenced. SMARTY is very nice at doing this, but as per previous concerns it should be optional and not mandatory as it is way too slow.
<html> <head><title>Title</title></head> <body> // Some tables, whatever <?php echo $header; ?> <?php echo $body; ?> <?php echo $footer; ?> </body> </html>
$header, $body and $footer are EXTREMELY BASIC examples of how a variable interpolation theme could occur. I imagine the somewhat strange of you are asking "Why not use Smarty" - the answer is that it is TOO BIG AND SLOW!!