As there is a wide variety in things that can theoretically be taken from a hotel room, I'll restrict this answer to the items listed in the question (and to my limited experience in countries):
So for example you can get towels, slippers, candies, pens, shampoos, shaving kits, sponges, ...
Towels are usually exchanged during your stay, and reused across guests after laundry. They are not meant to be taken by guests. Clues to support this point:
- Hotels near the sea often explicitly point out in their hotel rules in each room that it's prohibited to take the towels to the beach, and usually it is also forbidden to take the towels to the sunbeds at the hotel swimming pool. Guests are supposed to use their own towels for that purpose.
- Essentially all hotels that I have been to, both in Europe and in Asia, made the procedure of exchanging towels quite explicit. While they explicitly speak about getting a new one when it comes to the other items you list (i.e. implicitly saying they don't care what happened to the old one), towels are usually said to be exchanged or replaced, thus implying that the new ones only come in exchange for the old ones (e.g. on the standard signs found in most hotel bathrooms that point out that only towels on the floor will be exchanged, and that you should save water and the environment by not requiring new towels every day).
As for the other items, they can usually be taken away. Judging by other answers and comments, slippers seem to be a special (varying) case, however, I personally only know slippers in hotel rooms from Chinese hotels, where they are most definitely one-way products.
For many of the remaining items, you need to consider the following: Maybe you have noticed that almost all of them, in particular pens, often also shaving kits and sponges (or their packaging), are printed with the hotel logo. That is probably not just to give you a feeling of corporate identity while staying within the hotel room, but, as always with low-cost items, for the advertisement factor. Especially the pens (and the paper often accompanying them) is expected to be taken away and used outside of the hotel, so the hotel name is spread (same as with all the pens that you get as gifts in other places). I think this can often be assumed for the other remaining items, too, and it also applied to the hotel slippers that I've come across.
I personally follow the general rule that, unless there are any explicit pricing signs for the items in the room, I usually take all of these items at least once during my stay, open or not. My suspicion is anyway that in many hotels, all items are thrown away when you leave, so the hotel doesn't risk leaving a used item (without any visible traces of the use at the first sight) in the room for the next guest.
The same in the self-service breakfast: pastries, bread, ...
I have seen many hotels (primarily, I remember this from various European countries) whose breakfast buffets have quite noticeable signs that it is strictly forbidden to take anything from the buffet out of the breakfast room. Obviously, the rationale is that guests who are paying only for breakfast could otherwise take enough food to also have lunch and dinner in the breakfast buffet, which is neither computed into the breakfast prices, nor is it the way the hotel would like to charge if guests actually do have lunch and dinner in the hotel.
In general, I would assume that you cannot take anything from the breakfast buffet for later use, even if it is not explicitly stated.
EDIT: One thing that I just remembered: Especially with "travel equipment" such as sewing kits (usually a piece of cardboard with one or two needles and a few centimetres of yarn), I have already considered those a service of the hotel for the traveller for the entirety of their journey. The chance that I have to sew something right when I encounter a room with a sewing kit is somewhat small, but the chance that at some point during my journey, I have to sew something, open the little sewing kit and once again am positively reminded of the fabulous service of the hotel I got the sewing kit from. Yes, those should be safe to take, as well.