Better:

```python
new_value=re.escape(os.getenv('HOME') or '')
```