Is this just:

```python
return ''.join(fileinput.input([path]))
```

?