Why is maze rendering so slowly?

The error means that you’re inheriting from NodePath, but you’re not calling the parent class constructor (NodePath.init(self)) in the constructor. However, you should ask yourself what you’re gaining by inheriting from NodePath; it is not a magic formula to solve any problems here, and from what I read, it doesn’t solve any problems at all in this case.

It is very likely, as Thaumaturge suggested, that your problem is that you have too many Geoms. In your code, you create a new GeomVertexData (and therefore a new Geom) for every wall segment. This is very performance inefficient. Flattening helps slightly (though flattening individual cuboids as suggested is pointless), but it would be far more wise in this case to simply generate all the geometry as part of a single, large Geom in the first place or perhaps a few Geoms (one for each major section of the maze), rather than one Geom per piece of wall.

Instead, I would create a single MazeRenderer class which stores a set of GeomVertexWriters, and visits all the cells and generates the polygons for those segments using the same GeomVertexWriter object.

Note that you can significantly speed up performance of geometry generation by telling the GeomVertexData and GeomTriangles beforehand how many rows you’re going to write - consult the API reference for this.