Officials estimated that a weekend visit costs the township about $42,000, which, the mayor said, was not an insignificant sum for a municipality this size. But a bipartisan spending agreement recently reached in Congress would set aside about $60 million to reimburse localities for law enforcement costs associated with protecting the president, his family and his residences since the election.

On this trip, Mr. Trump returned to a place where he has plenty of supporters, having narrowly won in the township in the election. “I’m proud to be living down the road from where the president is spending some down time,” said Cindy Decorges, a real estate broker who lives in neighboring Far Hills. “If he ever has down time,” she added.

He has developed a connection to the area since he bought the Georgian Revival-style mansion that had once been the estate of the automaker John Z. DeLorean in 2002 and built the golf course on the more than 500 acres of land around it. He has even indicated that he might want to be buried on the grounds.

The golf club is one of the largest taxpayers in the township, and Mr. Parker said that the Trump Organization has often contributed to local charities or allowed groups to hold fund-raisers there, supporting the local fire department or a school parent-teacher organization.

“I think he’s pretty warmly received,” Mr. Parker, a Republican, said in one of a string of interviews he gave last week. “I will say, that doesn’t mean everybody is completely in lock step behind his politics, but as a neighbor, they view him pretty favorably.”

Still, his visit drew a modest assembly of protesters on a street corner outside a library, holding signs that declared that he was “Not My President” and called him “Liar in Chief.” The recent vote in the House of Representatives to repeal and replace the Affordable Care Act had left them even more incensed.