Boyle's law is just a special case of the ideal gas equation, for an isothermal change. But you are putting too much emphasis on air and surroundings. This just means: Boyle's law holds, if the change is isothermal - usually that means you have some type of heat exchange that keeps the temperature constant when you are changin volume - it could be heat condution with outside gas, or a hot piston, or water bath, or kept constant with electric heater, or by exchange of thermal radiation through vacuum. It doesn't matter.
In thermodynamics, your "system" is always the only thing you care about. It's exchanging work and heat with surroundings, but the laws hold for the system regardless of the nature of environment and howe work and heat are passed in and out. There is nothing special about a piston in space. It's the same as just having an insulated piston. If we ignore other means of heat exchange, the change will not be isothermal, but adiabatic (if it's done reversibly). So Boyle's law is useless. You need the whole ideal gas equation and the details of the adiabatic process (the ratio of specific heats). So the result is increase in temperature, just like you would expect in any adiabatic change. It happens in your car's pistons, too.