I found that AddShaderReplacement
didn’t work from Python for geometry shaders, so I have used vtkOpenGLPolyDataMapper::SetGeometryShaderCode.
You can see a simple example here that takes in a cube and replaces each vertex with a pyramid. The example uses the FURY library, but the shader part is raw VTK.