Can you use string formatting here? Something like: 
```python
return "{base}/register?course_id={cid}&enrollment_action={action}".format(
    base=BASE_URL,
    cid=self._course_id,
    action="enroll",
)
```