How many swear words should you have in a conlang, and how are they designed? What is their purpose really? And should any other "regular" words be constructed out of them? Like if "bar" was a swear word, then "foobar" was a goose or "barfoo" was a house, is that a problem? Also, what are swear words actually, do they have a consistent meaning across cultures?
As jlawler mentioned in a comment, every culture has "taboos" (also sometimes spelled "tabu", borrowed from Polynesian). The term usually refers to objects and actions that are somehow culturally forbidden or repulsive, but it can also refer to concepts and words.
What words are taboo varies a lot by culture. Nowadays in American English they tend to refer to sex and bodily functions (fuck, shit, ass, slut). In other, usually older varieties of English, they had more to do with religion (damn, hell, bloody). In Classical Latin you would swear by a god or a demigod (one of the most common expletives is usually translated "by Hercules"). In some long-ago ancestor of English, the Proto-Indo-European word for "bear" seems to have become taboo, which is why we say "bear" (possibly from a root for "brown", possibly from a root for "wild animal", there's not a consensus) instead of some cognate with Greek arktos.
The one constant, though, is that there'll always be some sort of taboo (both culturally and linguistically). If you're inventing a conculture, decide what they consider forbidden. If you're tying your conlang to an existing culture, look at what words they swear by. But in a natural language, there will always be something that's considered offensive.
Swear words can mean different things in different cultures & languages. I speak English as my first language, where most of our swear words are known as "potty language" & for good reason. Most of the English swears are about sex or the body.
In French, the language of my dad's family, a bunch of the swears are evangelical. I'm not sure that's the right word. What I mean is that most curse words are about the church. Now there's an interesting point to be heard there! What do we call swears? "Spitting oaths"? Promises basically. Using the Lord's name in vain.
Using the Lord's name in vain does NOT primarily mean "oh my god lol", it means "I swear to God" or when you put your hand on the bible in a courtroom & say "I swear to speak the truth" or whatever. If you keep your word, then good for you. It is "bad" when you swear on the bible or God's name & then break your promise/oath. So that might be why French swears are often religious. Similar to the religion argument, bad words are often called "curse" words.
I recommend watching this https://www.youtube.com/watch?v=RAGcDi0DRtU comedy sketch & I think he has done a few more acts about curse words too.
I had read a book series (Codex Alera) where they use "crows" as a swear word. I think this is because crows are a motif throughout the books & might have some sort of special power, which means that they always end up on battlefields, feasting on the carrion & fallen friends. I believe Carrion & Maggots might also be swears. "Crows take it/you" means "god-damn it/you". They even just use "(oh) crows" to mean "(oh) heck/shit".
They use "Bloody" (as in "bloody crows" to mean "holy shit/smokes/cow/crap" or "bloody/fucking hell") which is a word used in this world. Bloody is used as an intensifier.
In relation to the religious swear/curse words, they also say "great furies" as in "oh my god". The furies are basically (pokemon crossed with spirit guides crossed with the concept of animism) who give powers to the owners like bending in ATLA. The great furies are like the spirit who lives in the mountain & his wife the storm/wind/bad weather on top of the mountain. So they can swear by the Great Furies as the folks on earth say "I swear to the Fae" or "God help me".
Another concept to consider is slurs. Slurs are usually based on or used against marginalized communities. (Black people & any marginalized racial/cultural/ethnic group; down syndrome, autism, learning disabilities, & other mental illnesses, neurodivergencies, & disabilities; Romani/Roma (this one is actually a huge issue bc I know people named the G slur); trans, gay, otherwise queer, & intersex; etc.)
So to answer your questions: How many swear words should you have in a conlang, You only really need one or two source words, but you can use as many as one curse for every noun, verb, & adjective you invent. You could also choose a source category (religion, sex, even smth like plants or careers). Having a category might be able to limit you to a degree.
and how are they designed? I believe they usually come up naturally. Maybe through mistakes. Maybe some teen afraid of sexual maturity tries to desexualize things by thinking of different words (like "feet" in the bible, or maybe pull smth out of ur ass like "hawthorn berries") & then they accidentally pavlov themself into sexualizing hawthorn berries & now hawthorn berries are a euphemism for sex. As mentioned with the crows, they could be related to undesirable topics like death. In cultures where nudity is natural I would assume that sex swears are less common. (They sexualize people less in those cultures than cultures where modesty is the norm. Typically. I'm generalizing.) So if sex is a taboo topic, swears would be about sex. If death is a taboo topic, then swears about death would be more common. If the taboo topic is malicious magic, then curse words might actually be about curses! Slurs have more defined or easily assigned sources. Swears can be considered a subset of slang. I also had a thought while answering one of the later questions: Things that used to be ok are now slurs because the people are still hated. "coloured" used to be the correct term, but since society still hated POC it stopped being a proper term. "L**e" used to be the used term, but it is a slur, so people started using "handicapped", but that term also started feeling offensive & now "disabled" is the correct term. It is in part due to inaccuracies in language I suppose. Like how "hermaphrodite" is a perfectly useful term for hermaphroditic animals but is not an accurate term for humans (with disorders/differences in sexual development or who are intersex). This is more slur based than swear based though.
What is their purpose really? Their purpose is to emphasize. I don't usually swear, but sometimes, sometimes there is a situation that really warrants an oath. Promises (swear to god) are used to create honesty & binding. As in they are bound to their word. I think swears are also used as catharsis or emotional indicators. You use swears when you're angry, when you're courting someone, when you're really really excited... They are for emphasis, usually emotional. That's my opinion at least! My experience is my own.
And should any other "regular" words be constructed out of them? "Like if "bar" was a swear word, then "foobar" was a goose or "barfoo" was a house," I think maybe the other way around? As a mentally ill baker I deal with the term "retarded fermentation" because the word "retard" (the e is pronounced like "look") means "late". Tardy. I mentioned I speak french lol. A retarded fermentation is a fermentation (in sourdough) that takes extra long to develop more flavour. Slow. Late. When this term applies to a person, it means they are "mentally slow" I guess. Which is kind of true. You know how your brain is not fully developed until age 26? A ton of mentally ill/neurodivergent people don't finish brain development until age 30 ish. I think that it is more likely that words (that have related words) turn into slurs. Whether or not the related words are considered slurs is really a societal/cultural thing & can depend on the worldview of the people. Sam hill versus damn hell? Idk. One last thing to note: Basement is not a sexual word even though it has "semen" in the spelling.
is that a problem? It depends. I said it was a cultural thing. If you use a slur in a hockey name (Like the new york n*****s or smth) then yes that is a problem & a slur! If the word "semen" is in the word "basement" then no that is not an issue, they have different etymologies. For things like "retarded fermentation"? Well that's a touchy one. I dislike the term because the source word is now used as a slur, but it was chosen for its accuracy. Maybe changing it to "Fermentation retardé" would be better because it has a different pronunciation & placement & maybe that would be enough. For words like "asshole" to mean "anus" I would say that yes it is still considered a swear word because the first part, "ass" is used because it is a dirty word for bum. "pussy hair" would also be considered like that because it is the hair of the swear word, unlike pubic hair which is a perfectly fine term. So in general I would say it depends on how the words relate & how society reacts.
Also, what are swear words actually, I feel like I answered this ok throughout this answer. A swear word is a word with a connotation of unprofessionalism that is used colloquially to add emotional emphasis. Although the connotation of swears/swearing can change throughout cultures & time.
do they have a consistent meaning across cultures? Ah yes I just answered this! They do not have a consistent meaning! From my experience they have the connotation of rudeness & emphasis, but to other cultures they can be related more to spiritual impurity or the keeping of promises. They almost definitely have even more meanings in other cultures & languages. What is considered a "bad word" might not be what we consider "swear" words or "potty" mouth.
I hope this helped!
In Chinese, the most common insults are directed at a person's family, such as: "fuck your [insert relative]!" or "his mom!" is used as a general exclamation. It's not very common to say "fuck you" to a person, you would direct it at who you believe is their closest(?) relative.
(I believe this is also shared by other languages from cultures influenced by Confucian ideas.)
Also I noticed a lot of the other answers mentioned how profanity is based on a culture's taboos but I'm wondering if this is more of a eurocentric perspective because using people's relatives as insults isn't exactly a taboo.
Another thing that may be worth mentioning is the Chinese equivalent of "fuck off" is "roll away!" which also not a taboo.