I find GPT4 to be super useful at such tasks that can be very well specified and rather narrow. Treat it like a sidekick. Still makes mistakes and can be tedious but overall tends to be much faster than working on your own.
I built latextai.com to make it possible to do this directly inside Overleaf - you can edit your LaTeX and GPT-4 has context of your document! So it makes this kind of use-case even more powerful.
I paste performance critical methods I write into ChatGPT and ask it “can you do this more efficiently?” Normally it can. I love it.
The advantage of doing this is that the whole hallucination thing is avoided. Unlike Copilot which often writes garbage.
It's like if you had a tool box with a bunch of stuff in, but no crescent wrenches. You could certainly do some everything without them. But having a tool that does some stuff perfectly, is just amazing