This code to me looks like in Python there could be a nicer way of doing it:

```
val = some_heavy_foo(slow=True, side_effects=True, bar=lot_of_data)
if val is None:
    val = 0

```

Is there?

A possible use case:

```
total = 0
for lot_of_data in lots_of_data_list:
    val = some_heavy_foo(slow=True, side_effects=True, bar=lot_of_data)
    if val is None:
        val = 0
    total += val

```

I'd like to use `sum()` here, but of course:

```
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

```