After 20th level, you no longer gain base attack bonus, but rather epic attack bonus. This counts as base attack bonus for prerequisites, but all classes get the same epic attack bonuses: +1 at each odd level. So getting to +23 would require 25th level. With divine power or Tenser’s transformation setting your BAB to your character level, you could get it at 23rd instead. And prerequisites don’t care how you meet them, so the fact that this spell will wear off doesn’t actually matter.
But in order for this to actually work, you have to level up while one of these spells is actually active, so that when you make your choice of class for the next level, you have the BAB you need. Since these spells last for rather short amounts of time, that’s basically impossible barring the DM outright assisting you with the matter. However, if you manage to increase their duration—say, use Complete Divine’s Divine Metamagic feat to apply the Persistent Spell metamagic feat to your divine power so it lasts 24 hours—this process becomes a lot more plausible. It’s not impossible to imagine casting persistent divine power every 12 hours to guarantee you have the BAB you need 100% of the time. And once you have taken your 1st level of the prestige class, officially you are forevermore entitled to its benefits and to continue taking levels of it, even if divine power wears off and you no longer have BAB +23.
Beyond that, it’s extremely dodgy, but in theory divine power or Tenser’s transformation combined with a friendly bard’s inspire greatness would allow those spells to set your BAB to +23 at 21st level. And you can ensure you level up during this effect if the bard is a construct or undead, since those do not get tired and do not need to sleep, so they can play inspire greatness indefinitely.
For that to work, though, the two bonus HD from inspire greatness need to count as part of your “character level,” which unfortunately they probably don’t, at least for prestige classes, since the prestige class rules define character level as
Character Level: The total level of the character, which is the sum of all class levels held by that character.
Since inspire greatness offers HD, but not class levels, and this is probably the most-relevant definition, this probably doesn’t work. But the term effective character level is defined by the monsters-as-races rules to include HD:
Level Adjustment and Effective Character Level: To determine the effective character level (ECL) of a monster character, add its level adjustment to its racial Hit Dice and character class levels.
This is the definition more commonly used, but strictly speaking it’s probably the wrong one here. Also, there would be that quibble with “racial” HD, though I don’t think that’s a particularly fruitful line of argumentation.
Anyway, I don’t believe other effects like inspire greatness are available that could push this to earlier than 20th. Even if you could, Epic Level Handbook specifies that
[epic prestige classes] are classes that characters cannot pursue until they have already become epic characters in some other fashion,
so even if you have the BAB +23 you need some way around that, which is much harder. Even dragons—which Draconomicon allows to take epic feats even if they aren’t epic once they have reached old age—don’t have an exception for that.