Draw an ASCII checkerboard
To appreciate a power of non-type templates, try to implement body and append_body in plain C. You will see immediately why your approach is an abuse of templates.
Most important

body() returns a temporary object:

    stringstream stream;
    ...
    return stream.str();


and clang expectedly complains:

error: non-const lvalue reference to type
  'basic_string&lt;[3 * ...]&gt;' cannot bind to a temporary of type
  'basic_string&lt;[3 * ...]&gt;'
string&amp; wtail = body&lt;true&gt;(head, num);
        ^       ~~~~~~~~~~~~~~~~~~~~~