WRONG AND PARTIAL ANSWER I thought this was a promising approach but it's not, have a look to the comments. I highlighted in bold the parts where my reasoning was wrong.
If the number $n$ of logician is
$b^k - 1$ for some b (with b, k) integer
They can use
The same strategy described in the linked answer but assigning themselves vectors in $Z_b^k$ rather than binary vectors and computing the sum modulo $b$ rather than the XOR.
More specifically:
The logician agree beforehand on a numbering from $1$ to $n$ and each one is assigned the vector that corresponds to their number written in base $b$. For example, if there are $n=8$ logicians ($b=3$ and $k=2$) the first logician is assigned the vector $[0,1]$, the second has $[0,2]$, then $[1,0]; [1,1]; [1,2]; [2,0]; [2;1]$ and the last one has $[2,2]$. Each logician knows which vector is assigned to who.
They agree on the definition of $S$ as the entry-wise sum of the vectors of the logicians with black hats modulo $b$. They also agree beforehand to bet that $S$ is non-zero. All these things happen before the hat distribution.
When the hats are worn:
of course none of the logicians can compute $S$ because they don't know the color of their hats. But each of them knows that $S$ can have only two values: let $v$ be the vector assigned to one specific logician. They compute $S_v$ which is the entry-wise sum of the vectors of the logicians with black hats modulo $b$ excluding themselves. The real $S$ can be either $S_v$ (if logician $v$ has a white hat) or $(S_v + v)$ modulo $b$ (if logician $v$ has a black hat). Each logician makes the same reasoning in their heads.
When they have to answer the question:
If one choice of their hat color would make $S$ equal to zero they claim the other color. Otherwise they say "I don't know". If $S$ is non-zero the logician with vector $S$ will guess their hat color and the other ones will say "I don't know". if $S$ is zero all the logicians guess the wrong color.
that's not true (thanks @tehtmi). This reasoning works only for $b=2$ and using the XOR rather than the sum and modulo. That's because the XOR is the inverse of itself while the modulo sum is not, so it could be the case that neither $S_v$ not $S_v + v$ are zero for the logician which vector is $S$.
This gives them the same optimal survival probably of $\frac{n}{n+1}$ which is the probability of $S$ to be non-zero regardless on $b$.
that's also not true (thanks @thetni and @aschepler and @klm123). The possible values of $S$ are not equidistribuited.
proof:
see the linked answer replacing a bunch of $2$s with $b$, "XOR" with "sum of the vectors modulo $b$", $15$ with $n$ and $16$ with $n+1$.
To answer the question in which $N=10$:
again in the linked answer it is stated that "[this strategy] generalizes when the number of players $N$ is of the form $2^k−1$. If it's not, the players can pretend it is by ignoring some number of the players, which gives win probability $1−\frac{1}{2^k}$ where $2^k$ is the largest power of $2$ with $2^k−1 \leq N$".
Using my generalization they can
pretend that $N$ is $b^k$ for some $b$ with $b^k−1 \leq N$ (of course choosing $b$ such that $b^k$ is maximum) and ignoring some number of the players, which gives win probability $1−\frac{1}{b^k}$.
In this case they chose
$b$ to be $3$ and $k$ to be $2$, ignoring one player which gives them a survival probability of $\frac{8}{9}$ which is greater than $\frac{7}{8}$ as requested.
I'm afraid this strategy is not applicable optimally for a lot of values of $N$ (for example it is not possible to achieve a survival probability greater than $\frac{3}{4}$ for $N=4,5,6$).