The feats Racial Heritage (Human) and Gluttonous Gobbler are the path of least resistance for a typical Pathfinder character. For the typical D&D 3.5e campaign, were this player to want desperately his PC to have the special ability swallow whole at the earliest opportunity, he would try to convince the DM to include in the campaign the Pathfinder feats Racial Heritage (Human) and Gluttonous Gobbler. If the DM were unmoved, then he'd just play a druid.
While the question already briefly addresses some of these options, they're are some that are nonetheless worth examining in greater detail.
- While the 2nd-level Sor/Wiz spell alter self [trans] (PH 197) largely prohibits the subject from gaining the assumed form's extraordinary special attacks, the 4th-level Sor/Wiz spell polymorph [trans] (PH 263) et al. do not, making access to an effect like the spell polymorph by far the easiest way to acquire the extraordinary ability swallow whole.
The most convenient way of acquiring such an effect is likely the phylactery of change (Arms and Equipment Guide 135) (11,200 gp; 0 lbs.) that grants the wearer 1/day the ability to use an effect like the spell polymorph as a level 7 caster except with an unlimited duration. Likely unbalanced in contemporary play, the phylactery predates the 3.5 revision therefore is subject to "minor adjustments" by the DM (Dungeon Master's Guide 4). Compare the phylactery with, for example, the skin of proteus (Expanded Psionics Handbook 176) (84,000 gp; 2 lbs.) that grants the wearer at will the ability to use an effect like the psionic power metamorphosis (which likewise can grant the ability swallow whole) as a level 7 manifester.
The remorhaz (Monster Manual 214-15) is a Huge magical beast with 7 Hit Dice, a +11 natural armor bonus, and a burrow speed in addition to the special attacks improved grab and swallow whole, making it a decent form for the aspiring swallower save for the creature's lack of additional attacks, nonhumanoid shape, and inability speak.
- As the druid supernatural ability wild shape (PH 36) is based on the supernatural ability alternate form (Monster Manual 305), it grants the creature the assumed form's extraordinary special attacks, including the extraordinary ability swallow whole). Nondruidic wild shape alternatives are provided in answers to this question.
Inconveniently, so far as I'm aware, there is no creature of precisely 5 Hit Dice that's Medium or Small, possesses the animal type, and possesses the ability swallow whole. However, to start off, there is the 2-HD Medium giant toad (Oriental Adventures 195-6) and the 4-HD Medium dire toad (Monster Manual II 42, 46). (Oddly, the 3-HD Medium giant frog (Return to the Temple of Elemental Evil 158) is a magical beast.)
- Elegant yet highly controversial is, as a level 10 or higher rogue, taking with the class feature special ability—instead of, for example, the special ability improved evasion—the simply-named special ability feat to gain the monstrous feat Gape of the Serpent (Serpent Kingdoms 663), bypassing its prerequisites.
The special ability feat says, in its entirety, "A rogue may gain a bonus feat in place of a special ability" (PH 51), and the vast majority read the special ability feat as the creature still needing to meet the feat's prerequisites. However, a much smaller minority point to the omission of any mention of prerequisites and to the Monster Manual on Feats (7) as proof that the creature need not meet the picked bonus feat's prerequisites (cf. the fighter's class feature bonus feats ("A fighter must still meet all prerequisites for a bonus feat" (PH 38)), the monk's class feature bonus feat ("A monk need not have any of the prerequisites normally required for these feats…" (PH 41)). Most DMs, I assume, are in the majority.
This author is not taking sides on this issue, but, instead, merely presenting the concept that there's a possibility that the DM may rule that the rogue special ability feat doesn't require the creature to meet the picked feat's prerequisites. Flame wars over this issue have plagued the game since its publication. This author suggests approaching the DM with this possibility cautiously, perhaps after the DM's had a few drinks. Further, this player recommends not abusing it if it is allowed. If the DM says Sure, go ahead and take any ol' feat with the feat special ability, the player should strongly consider picking a dumb but fun and difficult-to-acquire feat like Gape of the Serpent (or, for example, the feat Baleful Moan (Libris Mortis 24-5) or Touch of Hate (Player's Guide to Faerûn 177)) rather than, for example, a potential or actual gamebreaker like Epic Spellcasting (EL 55) (for a rogue 10/sha'ir 1 (Dragon Magazine Compendium, Volume 1 51-7), obviously); Mark of Avernus (Fiendish Codex II 84); Metamorphic Transfer (XPH 48); or Perfect Multiweapon Fighting (EL 64).
(For comparison, the equivalent Pathfinder version of D&D 3.5e rogue special ability feat is the rogue advanced talent feat that eliminates ambiguity by instead saying, "A rogue may gain any feat that she qualifies for….")
- The challenging prerequisites for the monstrous feat Snatch and Swallow (Draconomicon 73-4) make it among the least likely ways to get the special ability swallow whole: the general feat Snatch (Monster Manual 304), Improved Snatch (Dr 71), Constitution 19 or higher, the type dragon, and the size category Huge. While it's an inelegant way to acquire the feat, the feat can be acquired with minimum shenanigans. That does not mean that the DM will appove every step!! Everything book-legal isn't also table-right.
For example, a human Clr1 that possesses the template half-minotaur (Dragon #313 94-5) so that she retains her humanoid type but has the size category Large and that's been affected by the 1st-level Sor/Wiz spell enlarge person [trans] (PH 226-7) followed by the 5th-level Sor/Wiz spell permanency [univ] (PH 259-60) (costing at least 2,960 gp) so her size category is Huge and that possesses Constitution 19 or higher (hence at least Con 13 before modifications) and the feat Skill Focus (Diplomacy) (PH 100) and that takes the domain Hunger (Spell Compendium 275) so that she gets a bite attack finally meets the prerequisites for (and can use!) the feats Snatch and Improved Snatch. Then it's a matter advancing a level while the subject of the 2nd-level Sor-only spell essence of the dragon [trans] (Races of the Dragon 112-13) so her type is dragon and taking as that level, for example, the first level of marshal (Miniatures Handbook 11-13) because "[i]f [she] already
has the feat [Skill Focus (Diplomacy)], [s]he can choose a different" feat and taking the elusive feat Snatch and Swallow.
All told, with an exceptionally ridiculous character background and 260 gp of debt, a buck naked just-entering-play half-minotaur human cleric 1/marshal 1 (ECL 3) that takes 1 flaw could have the feat Snatch and Swallow. However, to actually use the feat would require first drinking a potion of essence of the dragon (2nd-level spell at caster level 4) (400 gp; 0.1 lbs.) or another method of regaining the type dragon like, for instance, employing a similar wand (again, 2nd-level spell at caster level 4) (120 gp/charge) somehow (for example, the granted power of the domain Magic (PH 188) is of no help with such a wand) or mucking about with the feat Momentary Alteration (Unearthed Arcana 94) as described in this answer.
- The 8th-level Gluttony and Hunger domains spell bite of the king [necro] (Spell Compendium 28) does, indeed, "send a creature to a pocket 'stomach' dimension with a successful melee touch attack" if the creature fails its Fortitude saving throw, but when it "successfully exits [it] appears to cut its way free from thin air, appearing in a space adjacent to" the caster, so it's only sort of like the ability swallow whole.
The even more spectacular alternative is the 8th-level Sor/Wiz spell swallow [conj] (Dragon #323 66) that has "a horrific visual effect as [the caster's] mouth distends, swallowing the target and banishing it to a… chamber with constricting, pulpy walls." While similar to (and likely intended to be replaced by) the spell bite of the king, the spell has no saving throw and a target that frees itself from the chamber reappears, instead, where the swallow spell was cast.
The spells beast shape I et al. never grant a Pathfinder creature the universal monster ability swallow whole. By extension, the special ability swallow whole is granted by neither the spell polymorph et al. nor, for example, a druid's supernatural ability wild shape. But, the difficult summoner archetype synthesist—who wears an eidolon like a battlesuit—can himself, essentially, swallow whole using the the 3-point evolution of the same name. (Best not to ask where such a swallowed foe goes.) Beyond this, though, are a few other Pathfinder options.
- The witch archetype gingerbread witch—I swear I am not making this up—in addition to being able to conjure candy, smell children, and heal its familiar by baking it, gains at level 12 the extraordinary ability gruesome gobbler, which gives the witch
a bite attack that deals 1d6 points of damage for a Medium witch. As a full-round action, [the gingerbread witch] can make a single bite attack that deals double base damage (2d6 for a Medium witch) and functions as if she had the grab and swallow whole special attacks, allowing her to grab and swallow a creature of her size or smaller.
The special ability is complicated—it's over 250 words!—, but it does what's required with the minimum of shenanigans. That the archetype is icky is probably beside the point: is there a pleasant way to swallow whole?
- The ogre as a race has a Race Point (RP) value of 23, within spitting distance of the aasimar (15 RP), android (16 RP), fetchling (17 RP), wyrwood (20 RP), and wyvaran (17 RP), so a generous GM may allow into a group of PCs that've already picked such powerful races a creature slightly more powerful like this one. While the feat's prerequisites are steep—typically Improved Unarmed Strike and Improved Grapple (hence also Dex 13) in addition to being a Large ogre—, the feat Gluttonous Gobbler has the following benefit:
If you start your turn grappling another creature at least two size categories smaller than you, you can put the grappled creature in your mouth as a move action and attempt another grapple combat maneuver check (as though attempting to pin the opponent). If you succeed, you swallow the opponent as if you had the swallow whole special ability.
It's apparent, however, that the feat wasn't fully playtested: The extraordinary ability swallow whole says, "The amount and type of damage [dealt to a swallowed foe] varies and is given in the creature’s statistics," yet that information's absent. The GM must make some decisions even though the feat technically exists.
Also see the feat Racial Heritage (Human)—ogre is an option as Pathfinder giants are a subtype of humanoid—, allowing a very complicated human to pick up eventually the feat Gluttonous Gobbler. Also see the third-party race half-ogre, who (like the aforementioned complicated human) needs a permanent enlarge person before he can take the feat Gluttonous Gobbler.