Code to find the sum of the product of all size-n combinations of an array
It first makes an iterator object containing all the unique combinations of the indices of A


Brute force is the first step in "Make it work; then make it fast". Since it's the bottleneck, you need to take the second step: exploit the structure of the problem. Here there's plenty of algebraic structure to exploit (as long as numerical stability isn't a major issue).

In particular, think about divide and conquer. Rather than compute all \$\binom{S}{2} = \Theta(S^2)\$ pairs separately, take a running total and multiply each element by each of the previous elements simultaneously:

result, running_total = 0, 0
for a in A:
    result += running_total * a
    running_total += a


and you have \$O(S)\$ time. This can be extended for larger values of \$n\$ to work in \$O(Sn)\$ time and \$O(n)\$ space.