Use free function
Move Type::toCBuffer2 into the visitor