This explains the reason the overloading is permitted in C++. Both are functions, and since the return argument can be ignored, you can also call them the same way:
foo(a1,a2); // returns void, no error can occur
foo(b1,b2,b3); // returns int error flag, but we discard it
thus making the functions suitable to use in the same overload set.
But in Fortran, this might make you raise an eyebrow:
call foo(a1,a2) ! Huh, why doesn't foo return something?
stat = foo(b1,b2,b3)
Instead we adopt the Python zen “Explicit is better than implicit” and use the rename at import facility:
use baz, only: foo
use bar, only: foo_always_safe => foo
call foo_always_safe(a1, a2)
stat = foo(b1,b2,b3)
if (stat /= 0) error stop "foo failed"