The best way to seek the meaning of a word is from the document itself. Since Paul uses πάντων elsewhere, the letter provides the opportunity to examine Paul's use of the term (ESV):
First of all (πάντων), then, I urge that supplications, prayers, intercessions, and thanksgivings be made for all (πάντων) people, (1 Timothy 2:1)
for kings and all (πάντων) who are in high positions, that we may lead a peaceful and quiet life, godly and dignified in every way. (1 Timothy 2:2)
who gave himself as a ransom for all (πάντων), which is the testimony given at the proper time. (1 Timothy 2:6)
For to this end we toil and strive, because we have our hope set on the living God, who is the Savior of all (πάντων) people, especially of those who believe. (1 Timothy 4:10)
For the love of money is a root of all (πάντων) kinds of evils. It is through this craving that some have wandered away from the faith and pierced themselves with many pangs. (1 Timothy 6:10)
Paul always uses πάντων to mean all in the widest sense. Since "all" of the elders in verse 20 would mean some of the church, "all of the church" is the meaning consistent with the use elsewhere.
Also a meaning of "all of the church" would mean Paul is following the instruction given by Jesus:
15 “If your brother sins against you, go and tell him his fault, between you and him alone. If he listens to you, you have gained your brother. 16 But if he does not listen, take one or two others along with you, that every charge may be established by the evidence of two or three witnesses. 17 If he refuses to listen to them, tell it to the church… (Matthew 18:15-17)
There are 3 steps in resolving a dispute:
- Private: Handle it between the parties.
- Semi-private: Involve a few others.
- Semi-Public: Bring it before the church.1
Given this process and how πάντων is used throughout the letter, "all" means all of the church.
Yet some commentators interpret the verse to mean elders only. Raising the OP's question: which is the correct or better understanding?
The issue in verse 20 is a result of the imprecise language Paul chose. The reason for the uncertainty Paul creates is the uncertainty arising from the situation described in the previous verse:
19 Do not admit a charge against an elder (πρεσβυτέρου-singular) except on the evidence of two or three witnesses (μαρτύρων-plural). 20 As for those (Τοὺς-plural) who persist in sin, rebuke them in the presence of all, so that the rest may stand in fear. (1 Timothy 5:19-20)
Who are "those" (Τοὺς) who persist in sin? While it could mean the elder, it could also mean the witnesses. In fact, the plural language and construction make a stronger connection to the witnesses than to the elder.
After hearing the matter in what falls in line with step 2, Timothy must render a decision: was the charge made by the witnesses valid? If yes, Timothy must correct the elder; if no he must correct the witnesses. That should be end of the matter. But what if they persist in their sin?
The uncertainty in verse 20 arises over which matter. In other words, who is persisting in their sin. If the elder, they and their sin should be brought before all the church. If the witnesses, they and their sin (the continued false accusations) should be brought before all the church. Paul recognizes both situations are possible. Either way, the solution is to bring the matter before the entire church. This is especially true if those persisting sin are the witnesses. In that case they would also be impugning Timothy: he failed to render a correct decision when he heard their charge.
How should Timothy respond if a group insists his step 2 decision was wrong? He should let all of the church know the elder is innocent.
1. This is only semi-public because the issue is to stay within the church. The instruction is silent about bringing the matter before those outside the church.
2. An all elders meeting at the second step would be consistent with Matthew 18 and follow the Jerusalem Council (Acts 15) and Jewish tradition of the Sanhedrin. While not part of Paul's instruction, it is likely Timothy would convene a group that included elders to hear the charge borught against an elder.