A workaround is to build up the IndexedFaceSet node separately, then generate the markup string for the node, then use D3's selection.html(str) to append the node to the shape. In the code referenced above, "shape" is a selection of data-bound nodes, so the workaround is like this:
shape.each(function(d){
var newNode = "<indexedFaceSet coordIndex="..."><coordinate point="..."/></indexedFaceSet>";
d3.select(this).html(newNode);
});