In all cases, official bonds must be filed in the proper office within 40 days after the declaration of election or after the appointment to office, except bonds of tax assessors and tax collectors which shall be filed on or before September 1 next after their election or appointment.