Section 23. Any county may receive, hold and manage any gift by devise, bequest or otherwise, to the use or benefit of the county or any activity, institution, organization, board, commission or other public body to the use of which funds of the county are advanced or contributed. Unless otherwise provided by the donor, any money so received or the proceeds of any such gift shall be placed at interest in savings banks or savings departments of trust companies incorporated under the laws of the commonwealth, or in savings departments of national banks, or shall be deposited on paid-up shares and accounts of and in cooperative banks, or shall be used to purchase share accounts of federal savings and loan associations located in the commonwealth, or invested in securities which are legal investments for savings banks. The county treasurer shall be the custodian of such fund and securities, and shall invest and reinvest the same, and expend therefrom moneys as directed by the county commissioners.