When using flash, you can control how bright or dark the background by controlling your ambient exposure. A lot of people are afraid of flash, but it’s just another source of light. And it’s light you control.
As an example, while you’d never choose this busy background, let’s assume you need to shoot a light bulb indoors with a window in the background. Start with an ambient light shot like this. (Click on image to enlarge, then click on back arrow to return.)
To bring out detail in the bulb, add a flash at 1/8 power in manual mode off camera to the right. Note this is the same exposure as the first image. The only change is the added fill flash.
To darken the background, keep the flash setting (1/8 power), the ISO (64), and the aperture (f/14) constant. Then reduce the shutter speed to reduce ambient light. Here, the shutter speed was reduced from 2.0 seconds to 1/250 second.
Again, while you’d never choose such a background as this, this example shows that you can control the brightness of any background simply by using flash and changing shutter speed.