This goes back to celestial mechanics in the pre-calculus days. Orbits, arcs, chords, sinus, periapsis, and so on.
The term "argument" was used since I don't know how long ago, but it is described in the book "A philosophical and mathematical dictionary, containing an explanation of the terms, and an account of the several subjects, comprised under the heads mathemetics, astronomy, and philosophy both natural and experimental ... also memoirs of the lives and writings of the most eminent authors, both ancient and modern" (that's not the entire title) published in 1815 by Charles Hutton, 1737-1823.
(excerpt taken from Google Books)
The "argument" was an angle of some sort. Exactly how that term came to be, I haven't found yet. At some point in science history, the astronomers realized that the sinus and cosinus, being thus far known only as geometric constructs associated with lines and ellipses, could be thought of as functions of the argument. "Function" was a new concept back in those days. The notation f(x) had been invented around the early 1700s.
Naturally, astronomers were thinking "sinus of the argument of the periapsis" == "sin(ω)" and later as more functions were found to be useful, any "f(x)" came to be thought of as "function f of argument x". Even if x wasn't an angle. Mathematicians of all flavors and stripes came to use such terminology in general.
In the mid 20th Century, it was only natural for computer scientists to borrow the same terminology for their different but similar idea of a function as a subroutine taking any number of input values.
(This is one of those unusual topics that is easier to dig up answers for in a musty university library, than on the internet.)