If you can argue well with your DM, then there's an even better solution. The big problem is the interpretation of whether a staff requires a "class feature" aka. having a spell on a spell list. If you consider a spell list a class feature, and can slip this by your DM without a lot of detailed scrutiny (and therefor individual interpretations) then enjoy the ride:
Artificer 13+ or Rogue 10+ or Exemplar 1+ (for Skill master of UMD) = the ability to take 10 on a UMD check
Max ranks in Use Magic Device = 23
+30 competence item of Use Magic Device (or a Rod of Mimicry, if you can't get custom items) = 30 (or 10)
Skill Focus: Use Magic Device = 3
Charisma (we'll call it a 30 or so, difficult but not impossible by 20th level) = 10
1 level of Marshal for Motivate Charisma = 10
This is all before the bevy of cheesy items, feats and races/templates that add to charisma and skill checks). Given enough effort, total bonuses upwards of 70 or 80 are more than possible.
So far, we have a bonus of +56 on Use Magic Device checks, assuming the custom items get shot down. If you
can get custom items, have as many that give bonuses to UMD as possible. Then look at the artificer infusion Item Alteration.
Now, assuming you take 10 on the check (Skill Mastery), that's a 66 total.
Next, look at the fine print of Use Magic Device:
Emulate a Class Feature: Sometimes you need to use a class feature to activate a magic item. In this case, your effective level in the emulated class equals your Use Magic Device check result minus 20. This skill does not let you actually use the class feature of another class. It just lets you activate items as if you had that class feature. If the class whose feature you are emulating has an alignment requirement, you must meet it, either honestly or by emulating an appropriate alignment with a separate Use Magic Device check (see above).
Remembering that we're saying a spell list is a "class feature", this gives a caster level of 46. Get a staff of Holy Word or Blasphemy (remember, UMD can also emulate alignments), and let the carnage begin. Say goodbye to anything with 36 or less hit dice (It's just a shame that the Tarrasque has 48)
Disclaimer: This is based on a hazy rules interpretation. It's open to argument. However, the argument is plausible enough that some DM's might allow it (if they didn't think about the ramifications first). Yours might not. I take no responsibility for injuries caused by dice hurled across the table upon unveiling this monstrosity.