This topic comes up every so often, but it's okay because some things need repeating -
When I first got my "S" the previous owner was charging the bike with a 16 gauge computer cord. After a very short time charging, it was too hot to touch. I replaced the 16 with a 14 gauge cord, and it was still hotter than I thought it should be, so I replaced it with a 7 foot 12 gauge cord. A network switch turns it on and off, and after six hours the cord is only warm to the touch. It's scheduled to charge from midnight to six in the morning, cuz I get an EV discount. If it's above 30 % at midnight, six hours is a full charge. If it needs longer to charge it can pick it up the next night. It all seems to balance out. I also keep an extra 10 foot 12 gauge charging cord with the bike just in case I need a few electrons to get back home. Just like a 20 amp outlet holds the plug much tighter, a 12 gauge cord is quite firm on the bikes charging pins. A tight connection equals less heat. Here’s a link for the cool cord that will solve your hot problem.
https://www.amazon.com/dp/B078V9K14V?ref=ppx_yo2ov_dt_b_product_details&th=1