I wonder what 3 Blue 1 Brown uses. I heard he uses "a library he built himself, which now has a small community".

Edit: sorry for being a joke but I saw "Python library math animation" and I immediately thought of 3B1B but I really had no idea this was it!

Assuming you're not joking, this is the library Grant built (and released open source).

specifically it's a community variant of it. Grant still has his own version (https://github.com/3b1b/manim) where he works independently, and the community fork builds off that and e.g. adds and maintains things Grant might not care about.