(I'm generalizing the question here, and substituting 100 by $N$)
Claim:
The solution proposed by @StephenTG is one of the best solutions both in the worst case scenario and on average. It is also one of the best solutions for any other number of prisoners.\
@iBug 's answer explains:
why, from the placement of the envelope, we can only deduce the yes/no answer to one question only. Basically, his answer is saying that no matter what strat we are using, the only useful information that any prisoner has is their number (i.e., how many have died before them) and the position of the envelope, the reason being that these two are the only factors that are actually affected by the actual number in the envelope that a prisoner is able and allowed to know.\
Therefore, let's consider a criterion $A$. Then, for any number-in-envelope, it either satisfies or doesn't satisfy $A$.
As the answer is chosen completely at random, we can analyze matters probabilistically. Assume $P(A)=P(\text{the number satisfies $A$})=p$. Thus, there are $pN$ numbers that satisfies $A$. Since the information that the envelope can convey is just if the number-in-envelope satisfies $A$, to find the exact value, the prisoners will have to guess every element. Hence, in the worst case, the number of prisoners sacrificed will be $\max(pN,(1-p)N)$. Thus, the most optimal strat in terms of the worst case scenario is when $max(p,1-p)$ is the smallest, which is clearly when $p=0.5$.
Now let's think about the expected number of sacrificed prisoners. First, consider the following scenario: if we know that there are $x$ possible answers, what is the expected number of times that we need to guess before we get the correct answer? The answer is $\dfrac{x+1}{2}$, the average of the least and most number of times you will have to guess. Then, if we know the number-in-envelope satisfies $A$, then we would have to guess $\dfrac{pN+1}{2}$ times on average. Similarly, if the number-in-envelope doesn't satisfy $A$, then we would have to guess $\dfrac{(1-p)N+1}{2}$ times on average. From this, we can deduce (by the formula of expectation), that the expected number of times one would need to guess is $$E=p\cdot\dfrac{pN+1}{2}+(1-p)\cdot\dfrac{(1-p)N+1}{2},$$which, after some simplification, equals $$0.5N\cdot(p^2+(1-p)^2)+0.5.$$ By expanding and completeing the square, we have $$E=N((p-0.5)^2+0.25)+0.5.$$ As the square is always positive, the minimum expected number of guesses (i.e., the minimal number of prisoners sacrificed) is achieved when $p=0.5$, and is $$E_\text{min}=0.25N+0.5.$$ In our case, $N=100$, so $E_\text{min}=25.5.$
Conclusion:
We have proved that the optimal strat ensures that P(A)=0.5. In other words, any strat that ensures that exactly half of the possible numbers-in-envelope satisfies $A$ is optimal.