Well, this was fun.
The problem was introduced in commit 8b270da, 17 Oct, when the ability to call stored python templates added. The python caller class is instantiated by the formatter. Unfortunately the caller class cached a copy of the formatter instance, which was never nulled.
When metadata.book.deepcopy() makes a copy of a book Metadata object it makes a copy of the Metadata's formatter instance. Because of the above commit that instance contains a pointer to itself, so we have infinite recursion. Bang.
Fix submitted.