You could almost call it "something (such as an instrument or apparatus) used in performing an operation."[0]
[0]https://www.merriam-webster.com/dictionary/tool
Definition 1C in the link you provided lists "a means to an end" as a definition of a tool, which I explicitly mentioned code was.
So I must concur, code is a tool. But I'm adamant that it is also a liability.
You could almost call it "something (such as an instrument or apparatus) used in performing an operation."[0]
[0]https://www.merriam-webster.com/dictionary/tool