This could just be:
```python
target_host, _, target_port = target_host.rpartition(':')
```
(assuming you want target_port to be an empty string if it isn't specified)

At the very least, split() should be passed a count to avoid crashing if someone specifies a host with more than one colon.