Short answer : a constant function is still a function.
As long as the output exists and is unique for a given input, its a function.
Consider this mathematical function : f(x)=10 . It maps every real number to number 10. That does not prevent it from being a function.
Same thing for g [(x,y)] = 1000 . No matter what couple of numbers is taken as input, he output is 1000. It maps every point in the XY plane to number 1000.
If you consider a well formed formula as a function, it takes a truth value ( or an n--tuple of truth values) as input and gives back a truth value as output.
For example the expression " (P v ~ P)" is a function from the set : T, F to the set : T, F . For every input , it gives back as output the value : T.
The formula : " If (P-->Q) and P then Q" is a function from the set of couples : TT, TF, FT, FF to the set : T, F. For every input it gives back T as output.