How to collect the global mesh without writing a file

It’s mostly to automate visualisation with PyVista. At the moment, I don’t have anything meaningful, but would prefer to generate plots of the whole thing programmatically instead of saving a file and opening it on ParaView. The comment about Gmsh is because the alternative is to save a mesh file, which I want to avoid.