Manipulating a general length function
Something like the following?
ClearAll[s]
s[seq__] := Total[f@@@Subsets[List[seq], {2}]]
ClearAll[s]
s[f_] := Total @ Subsets[f @ ##, {2}] &;
s[f][a, b, c]
f[a, b] + f[a, c] + f[b, c]
s[f][3, 4, 5, 6, 7]
f[3, 4] + f[3, 5] + f[3, 6] + f[3, 7] + f[4, 5] + f[4, 6] + f[4, 7] + f[5, 6] + f[5, 7] + f[6, 7]