Yes, it is possible, but...
... you're going to have to put up with the moaning and screaming of the rules being bent into unintended little pretzel shapes and then braided into your character's hair done up in a pretty pretty princess crown.
Please keep in mind that this is all rules legit, but will be taking a very fast, loose, and light-hearted approach to the rules more commonly found among CO or TO communities. (Character Optimization and Theoretical Optimization, respectively.)
Step One: "Blast it, Jim, I'm a weapon, not a character!"
You have a couple of options here that immediately spring to mind: Intelligent weapons and Construct-weapons.
Constructs are somewhat easier, as they are already a creature type, and can be awakened by the Awaken Construct spell. Presto-instant character. Most constructs are humanoid or monstrous in shape, but nothing says you can't make a weapon-shaped construct (though some DM's might want to have a say in this).
For a existing rules precedent, you can see the construct-homunculus from the Eberron setting, some of which are actually more weapon than anything else (crossbow-type, anyone?) As an awakened construct, they gain XP like everyone else and are truly an independent character. If a walking or floating weapon doesn't appeal, you could figure out a method for them to shapeshift into a humanoid shape, even if you have to make up a DM-fiat shape change ability to fit the bill.
Intelligent weapons are also considered constructs, as stated in the DMG in the first few paragraphs on how to craft them. They have mental stats, they can see, they can think, some can even move themselves around (depending on what their powers are), but as weapons specifically, they become limited by the crafting rules that restricts the total GP value to ~200,000 gp (not including certain crafting costs).
Should such a weapon have a special property or power of shape changing (perhaps limited to only one form or so), then it could effectively act as a character. However, it would not gain any xp, and it could only progress if it had extra abilities added onto it after the fact using gold and the crafting rules.
Possibly solution to the intelligent weapon issue are the legacy weapon rules. These rules specifically allow for a weapon to grow over time, though the way the rules are written, it would again require a lot of DM input and cooperation to make it work. If lacking growth-by-xp and personal choice over enhancements doesn't bother a player, then this could work.
Step Two: "Highly illogical."
Once you've picked your poison, you'll have to figure out the details and then live with the results.
Personally, I favor the awakened construct-weapon route, as that grants an actual creature type (and clear xp progression) MAYBE still allows for GP-addons at a later date via the homunculus origin, and if allowed, as a bonus it isn't restricted by the non-epic cap on crafting value. However, once it is awakened, does it still retain the ability to add-on the same as a weapon-homunculus does? Tough call.
You could even play with fire by trying to get around this issue by taking advantage of the implication in the rules that any body without a spirit is not a creature (seriously borderline TO, here) and magic-jar your weapon-character during any reforging/crafting addons that take place at a later date, should that particular flag ever get raised. Don't forget the Improved Homunculus feat, for it's very useful additions.
Option the Second: "I knew psionics were good for something!"
The psionic power Graft Weapon allows one to attach a weapon to their limb.
Combine with the Warshaper prestige class for some really odd results.
One may also wish to consider the Master Transmogrifist prestige class's capstone ability Infinite Variety wherein you are permitted to polymorph into made up forms. This is generally limited to spellcasters, however, though some may rule that psionic powers Metamorphosis and Greater metamorphosis also qualify one for this prestige, depending on DM. (They also allow one to take the form of objects, which is an advantage for this character type.)