Running a motorcycle with the petcock in the "off" position until the motorcycle stalls will not typically ruin the engine. However, it's not recommended to intentionally run the engine until it dies by starving it of fuel.
The primary concern when running the engine with the petcock off is fuel starvation. By cutting off the fuel supply, the engine will eventually consume the fuel present in the carburetor float bowl or the fuel injection system, leading to a lean fuel mixture. This can cause the engine to run poorly, misfire, or eventually stall.
While a short duration of fuel starvation is generally not detrimental to the engine, repeated or prolonged instances can lead to adverse effects. Running the engine in a lean condition for an extended period may cause overheating and potential damage to engine components such as valves, piston rings, or cylinder walls. Additionally, it can increase the risk of running the engine with insufficient lubrication, which can result in accelerated wear or damage to internal parts.
To ensure the optimal performance and longevity of your motorcycle's engine, it's best to avoid intentionally running it with the petcock off until it stalls. Instead, it's advisable to use the petcock in its proper position (typically "on" or "reserve") to allow a consistent fuel supply to the engine during operation.