Well, what I was thinking is you'd have to hack it obviously. But, the first thing is it's not going to just sit still. You need some kind of tool that can trap anything, even things that aren't trapped by Black Hole Machines. Something immune to the Devourer. So, there's some kind of project to acquire or build that, maybe in cooperation with the Zenith Trader. Then, you need to reinforce some kind of hacking computer station against the Devourer OR just create a computer powerful enough to hack the Devourer, while you distract the Devourer with tasty treats in the form of swarms of ships. Effectively, it's actually a big test of your economic/micro sort of prowess maybe. As you hack it the Devourer needs more feeding to remain distracted. Once it's done hacking, the Devourer has been given such great munitions that it shuts down...
...and well... then you can repair it, maybe. But, only a fool would repair a demented angry Devourer Golem on their own planets! You probably need to, say, drag it closer to AI territory so that when you do repair it, it will head deeper into AI territory. Tractor Beam ships could probably do this. Otherwise, you can give the shut down Devourer some movement speed and player control and call it a 'rocket attached to the Devourer Golem'. When the Devourer is dragged to where it needs to be, you can begin repairing it. This is only done through the explicit order to repair it. Once the repairs start, the AI suddenly realizes what you've done and will prepare big waves to hit the devourer and destroy it while its shields are down! Oh no! But, it's okay. The Devourer itself has plenty of health, for sure. Once the Devourer is finished being repaired, it will move towards any large clumps of ships. If it can't find any, it will move towards the nearest homeworld (human OR AI), instantly killing anything in its firing range in its path. The placement of the golem is absolutely key here. Although, it helps that the AI is actually attacking so it will be drawn away from you. You can expect your AI Progress to skyrocket, but the Devourer won't take long to take down a home command station. Not by any stretch.
There's probably some way to knock it off course, in case it does start heading towards you. It probably needs to be really powerful, or something that requires a lot of tactical prowess to pull off. Also, if the Devourer were to die in this state, it would emit a galaxy-wide nuclear explosion on death. Maybe even if it died in the broken state. Who knows?