(Grabs Cajori's History of Mathematical Notations.)
Apparently the use of parentheses to indicate function application "occurs in Euler in 1734" and in D'Alembert in 1754. The commas to separate multiple arguments appear in Euler in 1753. The standardization of this notation might have been "[d]uring the early part of the nineteenth century [when] functional notations found their way into elementary textbooks" such as Legendre's Elements of Geometry in 1845.
But there's still another tricky thread about how computer programs came to be organized into "functions" even when some of them (like print()!) aren't actually functions in the mathematical sense.
I'm not clear on how subroutines or subprograms became known uniformly as "functions". (I understand the analogy to mathematical functions, but early computer programming didn't consistently use that analogy, and many programming languages referred to subroutines or procedures rather than, for example, void functions.)
The C "void function" concept clearly contradicts what a "function" used to mean. I suspect the trend might have started somewhere around BCPL (before 1967), which was predecessor of B, which was predecessor of C. Its manual said:
> The semantics of a routine definition is exactly as for a function definition except that the body of a routine is a block and therefore its application yields no result.