Find out number of function arguments or if passed at all

This other thread might be of interest.