A git bisect shows that the offending commit introduced this hunk
--- /dev/null
+++ b/templates/all_entry.mdwn
@@ -0,0 +1,23 @@
+## <TMPL_VAR year>
+
+There
+<TMPL_IF current>
+have been
+<TMPL_ELSE>
+were
+</TMPL_IF>
+[[!pagecount pages="
+log/* and !tagged(aggregation) and !*/Discussion and !tagged(draft)
+and creation_year(<TMPL_VAR year>)
+and !*.png and !*.jpg
+"]] posts
+<TMPL_IF current>
+so far
+</TMPL_IF>
+in <TMPL_VAR year>.
+
+[[!inline pages="
+ log/* and !tagged(aggregation) and !*/Discussion and !tagged(draft)
+ and creation_year(<TMPL_VAR year>)
+ and !*.png and !*.jpg
+ " archive=yes feeds=no]]
The lines which feature creation_year(<TMPL_VAR year>) are most likely the culprits. That would explain why the error was repeated twice, and would tally with the file in `templates/` being rendered, rather than the inclusionists.
A workaround is to move the template outside of the srcdir into the external templates directory and include the file suffix when using it, e.g.