I think you are right that the notation has not been widely adopted, but many programming languages do have conditional expressions using a different syntax. some have the comb structure of McCarthy's notation. Others are binary-branching and give McCarthy's conditional through nesting.
A binary variant $t\to a,b$ "if $t$ then $a$ else $b$" of the original notation is used in the denotational semantics of the programming language Scheme (possibly more widely in the semantics community, but I wouldn't know). When nested so that $b$ is another conditional expression, it becomes McCarthy's original (assuming parentheses are optional) up to the last expression which is an "else" branch:
$$
p_1\to e_1, p_2\to e_2,\cdots, p_{n-1}\to e_{n-1},e_n
$$
With McCarthy's notation, it was usual for the last condition to be always true anyway.
Lisp has always had, and still has, the comb-structured McCarthy conditional, and the binary-branching variant is also standard for decades:
(cond ((p1 e1) (p2 e2) ... (pn en)))
(if t a b)
The C programming language uses the following notation for binary-branching conditional expressions. Many later languages have adopted this notation. The user population has named the pair of characters the ternary operator.
t ? a : b
The Python programming language has a different variant:
a if t else b
Both of the above two can be chained to give the meaning of McCarthy's comb-structured expression. (One should also look into other, so-called functional programming languages for more of these, but the main point is that conditional expressions are well and widely available in programming languages.)
The brace notation of mathematics is different in that the order of the branches is not significant. An "otherwise" branch may be used, but the following is considered wrong because it would specify both values when $x = 2$.
$$
\begin{cases}
4 & \text{if $x\le 2$} \\
3 & \text{if $x\ge 2$}
\end{cases}
$$
Mathematics has its own device: functions that give $1$ when a condition is satisfied and $0$ otherwise. This allows at least numerical expressions
whose value depends on the condition:
$$
a\cdot t(x) + b\cdot t(x)
$$
The Graham, Knuth, Patashnik book, Concrete Mathematics: A foundation for computer science advocates the use of "Iverson brackets" for turning any statement into a truth value this way:
$$
a\cdot[x \ge 2] + b\cdot[x \le 2]
$$
There is even a convention to make the brackets so strongly $0$ that they can undo an otherwise undefined expression. (Use with care, I suppose.)
With (the binary-branching variant of) McCarthy conditional, the above would be:
$$
(x\ge 2\to a, 0) + (x\le 2\to b, 0)
$$
Or the original:
$$
(x = 2\to a + b, x\ge 2\to a, x\le 2\to b)
$$
Best Answer
I think the three most common notations are:
The first is an abuse of notation and somewhat misleading to people learning the subject, but it is common. The others, IMO, would be readily understood if you state once at the beginning of whatever you're writing what the notation means.
For your specific application you could also use the iverson bracket:
The Iverson bracket is basically the mathematical incarnation of the usual ways to coerce a boolean value to an integer: it gives $0$ when false and $1$ when true.
In the specific formula you write, a possibly more useful alternative is $$ 2^{[i \text{ odd} ]} = 1 + [i \text{ odd} ]$$ since this form is more amenable to doing series manipulations. In fact, the context of series manipulations is the first time I saw extensive use of the Iverson bracket.