I'd like to rig a portable CO2 or air tank about the size of a MSR fuel bottle and mount it to the bike.
The volume and pressure required are questions I don't know how to ask let alone answer.
I can help you with some of the math and practical considerations.
Not sure of the exact volume of a motorcycle tire, but let's say a rear tire is in the ballpark of 10 liters. To inflate it to 40 psi, the absolute pressure inside the tire is 55 psi, and that's what matters. So you need 10 liters times 55 psi. That means if you have a 1 liter container, it would have to be at 550 psi. But its not quite that simple, depending on how much 'reserve' pressure you have. For example, if you had the 1 liter/550 psi bottle available, and equalized it into the tire, you'd now have 11 liters of volume (10 for the tire, 1 for the bottle). So you'd have an internal absolute pressure of 50psi (11 liters * 50 psi = 550) or a gauge pressure of 35psi.
The working pressure of CO2 is around 1000 psi, so it would give you some extra margin and reserve pressure.
With a CO2 tank you have to go to an industrial gas place to fill it with liquid CO2, and you have your 1000psi from the natural working pressure of the CO2. Finding an air compressor that can achieve 1000psi or higher with plain air is also possible, at either a dive shop (3000psi) or maybe the same place that could fill a CO2 tank with liquid CO2. Bottom line is you aren't going to fill it yourself with either air or CO2.
The next hurdle is to convert the high pressure tank valve over to a schrader valve to attach to the tire. Depending on which style tank you go with, this will range from very easy to practically impossible.
The easy path is to buy a small standard CO2 tank, with a shutoff valve and pressure regulator to step down from the working pressure to normal tire pressure. Then you can attach any type of hose to the low pressure outlet side, and adjust the output pressure setting via the regulator. The problem with that is between the tank, the valve, and the regulator, its probably a bit larger in size than I suspect you'd like, and it probably costs close to $200. I'm not familiar with all the possible sizes, but for pure practicality that's probably the best approach if you can find something in a size you can live with. It will be safe, reliable, and you won't have to rig anything to make it work, it will just work.
A more difficult approach would be to try to adapt a paintball CO2 tank. I think there are more small tank sizes available for paintball applications, but I'm not familiar with any of the hardware/fittings for those, and you may run into proprietary designs. The best case scenario would be if you could find a paintball tank that is compatible with a standard valve/regulator assembly, but I suspect that's not likely because the tanks are designed to fit into a particular gun, not to be used standalone.
So I'd start at an industrial gas company and ask them about their smallest size containers, and if their sizes aren't what you need, go to the paintball suppliers next and see if they have any standalone tank systems that could be utilized. Don't try to rig things, at 1000psi things can get very ugly if something fails. Also, the CO2 supplier is only going to put CO2 into an approved tank, with a current hydro testing seal, so if you try to get creative nobody will fill it for you anyway (same with dive shops and plain air).