Formula, expression, equation, function. What's the difference?

Quite.

At the abstraction level of roughly calculus and below most math implicitly assumes it’s operating on the reals unless stated otherwise. An awful lot of computer calculations are implicitly integers unless stated otherwise. The differing default assumption trips a lot of the more amateur folks up. Regardless of whether they’re expert devs & amateur mathematicians or vice versa.
Back on the topic of exceptions, I just finished a wide-ranging wikigrination triggered by another thread. Serendipity led me to this page Go (programming language) - Wikipedia about one of Google’s in-house inventions.

The relevant point here is in that language functions natively return a tuple of (result, errorcode). Yet another way to skin the cat.

Getting back to the OP, a specific example might be instructive.

3x[sup]2[/sup] + 4x – 7 would be an example of a quadratic expression.

3x[sup]2[/sup] + 4x – 7 = 0 would be an example of a quadratic equation.

f(x) = 3x[sup]2[/sup] + 4x – 7 (or y = 3x[sup]2[/sup] + 4x – 7) would be an example of a quadratic function.

And, while the previous example (and maybe the others) could be referred to as a formula, the quadratic formula is the famous formula seen here: x = (-b ± √(b²-4ab))/(2a)