In the Forgotten Realms, making smokepowder has an Alchemy DC of 25 (see FRCS, page 97). Smokepowder is not exactly equivalent to gunpowder, so it may require special ingredients (that will, of course, cost less than the going price to buy smokepowder).
You'd still need someone to teach you how to mix smokepowder, though, and it would still cost you a pretty penny. The going price for a full powderkeg (20 lb.) is 400 gp (I don't know how much it would cost to make 20 lb. of it, though), and it would only be available in certain regions, like Lantan Island. The rest of the Realms aren't really interested in the stuff.