The City Council yesterday voted to allow Mayor Marion Barry to borrow $40 million from the U.S. Treasury to help the cash-strapped city government pay its bills and meet its payroll.

City officials had raised the specter of running out of money if the borrowing was not approved. But Barry's position has been that the council does not have authority to block such borrowing, and in the past he has borrowed money from the Treasury without the council's assent.

Under the Home Rule charter, the city may make interest-free loans from the U.S. Treasury, which must be repaid in the same fiscal year.

Despite questions raised recently by council members about the need to borrow the money and the city's ability to pay it back, there was no discussion of the measure before it was approved unanimously.

The council also voted to allow the mayor to sell 27 city properties, including two valuable parcels in Georgetown, to raise $14.7 million. Only member Charlene Drew Jarvis (D-Ward 4) abstained from the otherwise unanimous ballot.

In other action, the council approved extension of hundreds of municipal regulations -- in such fields as elections, housing and health -- that would have expired yesterday.

The rules would have become inactive because of a "sunset" law that declared them void if they were not published in an official D.C. compilation of rules by yesterday. The compilation, under way for several years, is still not complete. The new deadline for the regulations is Dec. 31, 1982.