You do not 'short' a commodity in the sense that you 'short' a stock. You enter into a contract.
Lets talk about GC's, 100 ounces of gold.
Scenario #1;
If you initiate a position in GC by buying a contract. You are agreeing to receive and pay for 100 oz of gold at a certain time. At the time of delivery you will pay an amount equal to the of the contract when you made the trade, times 100.
If you buy the contract and do not intend to receive the 100 oz of gold you would later sell a contract. This would null out your position. If you sell at a price higher than the initial price, you would make a profit.
Scenario #2;
If you initiate a position in GC by selling a contract. You are agreeing to deliver 100 oz of gold at a certain time. At the time of delivery you will receive payment in the amount of the price of the contract when you made the trade, times 100.
If you sell the contract and do not intend to deliver the 100 oz of gold you would later buy a contract. This would null out your position. If you buy at a price lower than the initial price, you would make a profit.
As TMCap explained, actually delivering or taking delivery of the gold is not a concern. The broker will close out your position and roll you over to another contract that has a delivery date in the future. No pun intended, of course.
When taking a position in a commodity, even though it is commonly called 'margin' it is actually a performance bond.
Margin, in a stock position, is collateral for the stock that you have borrowed.