When a character is hit by feeblemind and they fail the save, their Int and Cha scores drop to 1. This is clear. What happens if they were wearing a headband which increased either/both stats which is then removed? Would that 1 become -1 to -5? What if such an item were then placed on the person, would the ability score increase from 1 to 3-7? The same holds true for when the correct spell has been cast on the individual, either after being affected or before they are and it wears off.
A strict reading
Unlike most other effects that cause ability score damage, ability score drain, or impose an ability score penalty, the spell feeblemind causes the creature's Intelligence and Charisma scores to drop to 1 "until a heal, limited wish, miracle, or wish spell is used to cancel the effect of the feeblemind." And that's not damage, drain, or a penalty.
That means no matter what workarounds are attempted or what other effects are employed a creature that's been affected by the feeblemind has Intelligence 1 and Charisma 1 until the effects of the feeblemind are removed by a listed effect or another effect that specifically removes the feeblemind effect.
Thus, as neither donning nor removing a headband of vast intelligence or a headband of alluring charisma is listed as changing the effects of the spell feeblemind—and neither item calls out specifically that it affects the spell feeblemind—, neither item has any affect on the feeblemind-suffering creature's ability score.
Note: This reading is deliberately harsh, but so's the spell. The creature failed a saving throw against a 5th-level spell! On one hand, the creature could've died, but, on the other hand, the creature's now an unpleasant moron.
Feeblemind directly reduces your ability scores ("Target creature's Intelligence and Charisma scores each drop to 1")
Most abilities and items that affect your attributes don't actually change your ability scores. For example, a headband of alluring charisma "grants the wearer an enhancement bonus to Charisma of +2, +4, or +6". This is similar to, but distinct, from directly raising the ability score - the ability score doesn't change, but it counts as being higher for most game purposes.
As such, it doesn't matter whether the spell was cast before or after the headband was removed or put on; they don't interact with one another. A character under the affects of feeblemind while wearing a +6 headband would have their Charisma dropped to 1 but their effective Charisma would only drop to 7. Taking off or putting on the headband would allow them to switch between an effective Charisma of 7 and an effective Charisma of 1.
They probably couldn't do much with their effective Charisma of 7, because the spell also imposes a host of other nasty penalties, like being unable to communicate or understand any form of language. But they'd still have it.
I think the best way to handle Feeblemind, is as if it imposes infinite penalty on both Int and Cha. An affected character should remain mentally deranged even under buffs1. And it would be even more strange if she will fall unconcious from removement of some headband. And if it is handled the way I suggest (similar to Ray of Enfeeblement) affected creature's scores can't drop below 1, and as the penalty is infinite, they never rise higher than 1, also.
1) I believe, other penalties Feeblemind imposes intended to come from severely lowered stats. It isn't strict RAW, but may very well be RAI.