Limit how many topics one request can assign to a project
Nothing caps how many topics one request can assign to a project: the topics parameter of POST /projects and PUT /projects/:id, and the deprecated tag_list, take any number of names (https://gitlab.com/gitlab-org/gitlab/-/blob/0cbe3abd6db5ce784dfd92b60d3f4e0dd0b23faf/lib/api/helpers/projects_helpers.rb#L71).
Each topic that does not exist yet costs about six queries inside the save transaction: the checks !266664 (merged) adds before the save, then the lookup, the uniqueness checks and the insert in Projects::TopicList#topics. So the time a save holds its transaction grows with the length of the list.
A maximum number of topics per project, validated with the other attributes of Project, would bound it.
A database reviewer raised this in !266664 (comment 4177899783).