Whenever by statute a bond or other security is required for any purpose in an action or other proceeding in a court of record and if the party shall apply therefor, the court shall have power to prescribe the amount of the bond or other security notwithstanding any requirement of the statute; and in every such case money in an amount prescribed by the court may be deposited with the clerk in lieu of a bond. After a bond or other security shall have been given, the court in its discretion may require additional security either on its own motion or upon motion of an interested party or person. The courts shall exercise care to require adequate though not excessive security in every instance.