When using optical TOSLINK cable for isolation, would there be a problem in using it for measurements up to 2kV? I don't envisage any problems, since the optical cable is made of non-conducting material and is over 1m long, so creepage shouldn't be a problem. I'm just wondering if the insulation safety rating of the TOSLINK cable would be compromised, since it is actually designed for low voltage isolation of audio signals.
I recently had exactly the same question on the use of optical transceiver for galvanic isolation. My conclusion was an affirmative answer. As long as sufficient electrical clearance is provided, the lack of high voltage rating of the optical fiber is an non-issue. According to relevant safety standards, including IEC 60664-1, IEC 60950-1, IEC 62368-1 or IEC 61010-1, the cable is treated as a solid insulator, just like a piece of FR-4. If the insulation material is unknown, one is allowed to simply assume the material has a Comparative Tracking Index under 175 and belongs to Material Group: IIIb - the worst kind of insulator. Alternatively, it can be established with an independent test for proof tracking index (PTI) as detailed in IEC 60112.
The detailed answer will not be repeated here, please see Insulation safety ratings (working and withstand voltage) of fiber optics cables for an answer.
TOSLink is not designed for low voltage isolation of audio signals. A multitude of different TOSLink optical modules with various data rates and connectors already existed before one of them was chosen for use in CD players because it was suitable for the task at hand.
So what you call as "the" TOSLink, it specifically does not mean optical audio links with JIS F05 connectors and plastic optical fibre.
You have a selection of TOSLink modules available and you can likely find a TOSLink module with data rate, connctor, and suitable optical fiber that are rated to handle the voltage you need.
Standard optical consumer audio cables should of course not be used, as you likely don't know if they have been reinforced with metal or will the material be somewhat conductive due to moisture or humidity.
For continuous 1 kV, you need a POF (plastic optical fiber) cable rated for it. Your average TOSlink cable most likely comes from the same factory as the high voltage rated ones, but do a search and you'll find the good high voltage rated stuff. The high voltage POF stuff won't even mention TOSlink but it's the same 2 mm core POF as TOSlink uses.