Please note that armor piercing ammo is legal to purchase and possess in rifle ammunition but not in handgun ammunition. The law does this by outlawing armor piercing ammunition, then defining "armor piercing" by relating it only to handguns:
The term "armor piercing ammunition" means—
(i) a projectile or projectile core which may be used in a handgun and which is constructed entirely (excluding the presence of traces of other substances) from one or a combination of tungsten alloys, steel, iron, brass, bronze, beryllium copper, or depleted uranium; or
(ii)
a full jacketed projectile larger than .22 caliber designed and intended for use in a handgun and whose jacket has a weight of more than 25 percent of the total weight of the projectile.
That's not what AP means to real people or the military, but that's what it means under the law.
Second, while you can greatly increase velocity by lightening a bullet and using a fast burning propellant, you cannot guarantee penetration by velocity alone. Indeed, most studies show maximum penetration occurs only after a projectile has traveled far enough to settle initial yaw from that occurring at the muzzle. For a rifle this is usually around 200 yards. Handgun rounds are typically overstabilized by rifle standards, so the distance may be reduced to 50 yards or so, but there will be a maximum penetration impact range. Range short of that sees the bullet enter at a very slight angle, and fluid resistance at high velocity is so great that a small angle easily turns into tumbling, which greatly reduces penetration.
Hatcher's Notebook (pp. 406-407 1961 ed.) has photos illustrating the above. They show a 150 grain flat base spire point .30-06 fired at 50 feet penetrates solid oak just under 1 foot. At 200 yards the same round penetrates solid oak almost 3 feet. The difference is that at short range the bullet turns sideways, presenting much more profile to the oak for deceleration and fails to penetrate far.
A friend who was an engineer working on government projects told me they'd found the same thing trying to shoot steel rods into concrete as anchors. Up to something like 1700 fps they penetrated deeper with increased velocity. Above that, the ends would bend over and form a hook shape and turn in the concrete, penetrating less, not more.
The limit to velocity is imposed by the maximum velocity a propellant gas can accelerate its own mass to. When you additionally burden it with pushing a bullet mass, too, that number is lower. It seems to me the government experimented with firing bullets from guns using 20mm and maybe even 37 mm cases necked down to do .30 or .50 caliber in hugely thick guns, but couldn't get past around 6,000 fps. Someone may know the actual number, but the mass of the heavy gases is the limit.
My friend also took me on a tour of a lab firing the meteorite simulations. This consisted of a 40 foot gun that was separable into two parts in the middle. It was about 10 inch diameter steel all the way, resting on air bearings so operators could manipulate it. A 40 mm casing was loaded with about a pound of powder with a 40 mm plastic piston for the first half projectile. At the halfway point, 20 feet down the barrel, the bore necked down to .50 caliber. At the narrowing they placed a 1/4" aluminum ball into a two-piece Nylon .50 caliber sabot. Behind the sabot they placed a 60,000 psi rupture disc. They bolted the two halves of the barrel back together. They loaded the breech with the 40 mm piston sabot round, and then evacuated the space between it and the burst disc and filled that space with helium, which is much lighter than propellant gases and will move much faster under the same pressure. They fired the piston to compress the helium. When it reached the burst disc pressure, 60,000 psi helium drove the Nylon Sabot to 17,000 fps. At the muzzle it separated and hit an piece of armor plate drilled to pass the 1/4" aluminum ball and stop the sabot. The ball then was the meteorite simulator.
Rail guns don't use propellant gas. They charge a bunch of capacitors to high voltage and discharge them to create a plasma arc at the base of the projectile between two rails that have the voltage applied across them. The plasma short circuits the discharge and the reaction of the plasma to the magnetic field created by the current drives the projectile forward. No propellant gas mass limitations are involved.