In Jinja2 templating engine (using Flask), I want to achieve something like that:
{% reusable_block avatar(user) %}
I think you're looking for macros
You can use macros.
{% macro input(name, value='', type='text', size=20) -%}
<input type="{{ type }}" name="{{ name }}" value="{{value|e }}" size="{{ size }}">
{%- endmacro %}
<p>{{ input('username') }}</p>
<p>{{ input('password', type='password') }}</p>
More documentation here.