Turning off Automatic Panel Opening in After Effects
The option is specific to the Type Tool. Once you select the Type Tool, the corresponding Panels will open and the option will appear in the Tool Panel (which is on the top edge in the default layout).



Uncheck the Auto-Open Panels Option to turn that behaviour off. Once you do this, the Paragraph and and Character Panels shouldn't be toggled automatically anymore.

If you have rearranged your Workspace and there's not enough space for the Tools Panel, the Checkbox might not be visible in your layout. In this case, save your current Workspace (Window → Workspace → Save as New Workspace…) so you don't lose it, then switch to the Essentials Workspace and reset it by selecting Reset "Essentials" to Saved Layout in the same submenu. You should now have the default After Effects Workspace back and be able to see the Auto-Open Panels option.