Not sure exactly what might work for you. Using a non-python Topo plugins and surrounding those with your components may work too. There is more opensource links at the bottom:
- Ameba Topology Optimization Software
- Topological Optimization with Millipede
- More Millipede
- tOpos is a 3D Topology Optimisation for CUDA
- Here is a cool study done with RHino 5 and Python
You could contact Arjen, who has a lot of experience with TOpo and Grasshopper Open source: https://github.com/arjendeetman?tab=stars
TopOpt also comes with Open Source and Python 2.7: https://github.com/topopt/TopOpt_in_PETSc