schemdraw (python library) is a library for drawing beautiful circuit diagrams. It has a surprisingly effective flowchart part as well, that allows you even to draw custom beziers arrows and stuff. You can do manual positioning of everything, which is sometimes an anonoyance with mermaid. Outputs to svg or png. https://schemdraw.readthedocs.io/en/stable/
matplotlib (python library), people know it for drawing charts and such things, but if you want to build your own drawings that deviate strongly from existing solutions, all the drawing primitives are in there. See for example: https://matplotlib.org/matplotblog/posts/mpl-for-making-diag...
And for just wrapping your head around something, a piece of paper and a sharpened pencil are surprisingly effective at not wasting your time.