Just a non tested idea, but the build body function look to be built to append things easily, so with the right syntax that would be :
parts.append(
f'[event start="{start_local}" end="{end_local}" '
f'status="public" name="{summary}" timezone="Europe/Paris" '
f'allowedGroups="trust_level_0"] [/event]'
)