What does “autonomous” mean? There are a ton of template engines that don’t depend on a parent framework, there is no reason you can’t implement all features in C.
Jinja2 is an API and it needs a Python program to determine the values for the substitution variable and invoke the template engine. In contrast the M4 executable is the engine.
Something like mustache for example, which has a C implementation that includes support for includes/partials: http://mustache.github.io/mustache.5.html